A microservices-based full-stack platform that lets users list, browse, and rent items from each other — with a full rental lifecycle, image uploads, ratings, and email notifications.
- About
- Features
- Architecture
- Tech Stack
- Microservices
- API Reference
- Rental Lifecycle
- Getting Started
- Environment Variables
- Author
ShareUp is a full-stack peer-to-peer rental platform where users can act as Owners (listing items for rent) or Borrowers (browsing and requesting items). It features a complete rental lifecycle — from request to approval, return, and rating — backed by a Java/Spring Boot microservices architecture and a React frontend.
- 🔐 JWT Authentication — Secure login, registration, and token-based access
- 👥 Dual Roles — Separate Owner and Borrower dashboards with role-based access control
- 📦 Item Management — Owners can list items with images (Cloudinary), categories, pricing, and pickup address
- 🔍 Browse & Filter — Borrowers can browse and filter available items by category
- 📋 Full Rental Lifecycle — Request → Approve/Reject → Return (with image proof) → Return Approval
- 📧 Email Notifications — Gmail SMTP integration for rental status updates
- 🖼️ Image Uploads — Item images and return proof images via Cloudinary
- 🛡️ Structured Exception Handling — Clean error responses across all services
- ⚡ Optimized DB — Indexed queries, HikariCP connection pooling, lazy initialization
┌─────────────────────────────────────────────────────────┐
│ React Frontend (Vercel) │
│ React 18 + Vite + TailwindCSS + Axios │
└────────────────────────┬────────────────────────────────┘
│ HTTP / REST
┌────────────────┼─────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌─────────────┐ ┌──────────────────┐
│ auth-service │ │ item-service│ │ rental-service │
│ │ │ │ │ │
│ Spring Boot │ │ Spring Boot │ │ Spring Boot │
│ Spring Sec │ │ MongoDB │ │ MongoDB │
│ JWT + MySQL │ │ Cloudinary │ │ Cloudinary │
└──────┬───────┘ └─────────────┘ │ Gmail SMTP │
│ │ → auth-service │
▼ │ → item-service │
┌─────────┐ └──────────────────┘
│ MySQL │ (User accounts)
└─────────┘
MongoDB (Items + Rentals + Ratings)
| Layer | Technology |
|---|---|
| Language | Java |
| Framework | Spring Boot, Spring MVC, Spring Security |
| Authentication | JWT (JSON Web Tokens) |
| Databases | MySQL (users), MongoDB (items, rentals, ratings) |
| Image Storage | Cloudinary |
| Gmail SMTP (Spring Mail) | |
| Build Tool | Maven |
| Containerization | Docker (Dockerfile per service) |
| Layer | Technology |
|---|---|
| Framework | React 18 |
| Bundler | Vite |
| Styling | Tailwind CSS |
| HTTP Client | Axios |
| Forms | React Hook Form + Yup |
| Routing | React Router DOM v6 |
| Notifications | React Hot Toast |
| Icons | React Icons |
Handles user registration, login, JWT issuance, and profile management.
- Database: MySQL
- Key endpoints:
/api/auth,/api/profile - Security: BCrypt password hashing, JWT filter chain
Manages item listings, image uploads, and item status transitions.
- Database: MongoDB (
itemscollection) - Key endpoints:
/api/items - Features: Category filtering, Cloudinary image upload, status management (
AVAILABLE/RENTED)
Orchestrates the full rental lifecycle, ratings, and notifications. Communicates with auth-service and item-service internally.
- Database: MongoDB (
rentals,ratingscollections) - Key endpoints:
/api/rentals - Features: Borrow requests, approve/reject, return with image proof, return approval, ratings (1–10 stars)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/auth/register |
❌ | Register a new user |
POST |
/api/auth/login |
❌ | Login and receive JWT token |
GET |
/api/auth/health |
❌ | Health check |
GET |
/api/profile |
✅ | Get logged-in user's profile |
PUT |
/api/profile |
✅ | Update profile details |
| Method | Endpoint | Auth | Role | Description |
|---|---|---|---|---|
GET |
/api/items |
❌ | Public | Browse all available items (optional ?category=) |
GET |
/api/items/{id} |
❌ | Public | Get item details |
POST |
/api/items |
✅ | Owner | List a new item |
POST |
/api/items/{id}/image |
✅ | Owner | Upload item image to Cloudinary |
GET |
/api/items/owner |
✅ | Owner | Get owner's own item listings |
PUT |
/api/items/{id}/rent |
✅ | Internal | Mark item as rented |
PUT |
/api/items/{id}/available |
✅ | Internal | Mark item as available again |
| Method | Endpoint | Auth | Role | Description |
|---|---|---|---|---|
POST |
/api/rentals/request |
✅ | Borrower | Submit a borrow request |
PUT |
/api/rentals/approve/{id} |
✅ | Owner | Approve a rental request |
PUT |
/api/rentals/reject/{id} |
✅ | Owner | Reject a rental request |
POST |
/api/rentals/{id}/return |
✅ | Borrower | Submit return with image proof |
PUT |
/api/rentals/approve-return/{id} |
✅ | Owner | Approve the return |
GET |
/api/rentals/me |
✅ | Borrower | Get borrower's rental history |
GET |
/api/rentals/owner |
✅ | Owner | Get all rental requests for owner's items |
GET |
/api/rentals/owner/returns |
✅ | Owner | Get pending return approvals |
GET |
/api/rentals/{id}/return-image |
✅ | Owner | View return proof image (redirects to Cloudinary) |
Auth header:
Authorization: Bearer <token>
Borrower Owner
│ │
│──── POST /rentals/request ──────────────►│ Status: PENDING
│ │
│◄─── PUT /rentals/approve/{id} ───────────│ Status: APPROVED
│ or PUT /rentals/reject/{id} │ Status: REJECTED
│ │
│──── POST /rentals/{id}/return ──────────►│ Status: RETURN_REQUESTED
│ (multipart image proof) │
│ │
│◄─── PUT /rentals/approve-return/{id} ────│ Status: RETURN_APPROVED
│ │
- Java 17+
- Maven 3.8+
- MySQL 8+
- MongoDB
- Node.js 18+ & npm
- Cloudinary account
- Gmail account (for SMTP)
-
Clone the repository
git clone https://github.com/your-username/shareup.git cd shareup -
Configure environment variables for each service (see Environment Variables)
-
Run each service
# Auth Service cd auth-service mvn spring-boot:run # Item Service cd ../item-service mvn spring-boot:run # Rental Service cd ../rental-service mvn spring-boot:run
cd Frontend/shareup-frontend
npm install
npm run devThe frontend runs on http://localhost:5173 by default.
Each service has its own Dockerfile:
cd auth-service
docker build -t shareup-auth .
docker run -p 8080:8080 --env-file .env shareup-authPORT=8080
DATABASE_URL=jdbc:mysql://localhost:3306/shareup_auth
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
JWT_SECRET=your_jwt_secret_keyPORT=8081
MONGODB_URI=mongodb://localhost:27017/shareup_items
JWT_SECRET=your_jwt_secret_key # Must match auth-servicePORT=8082
MONGODB_URI=mongodb://localhost:27017/shareup_rentals
JWT_SECRET=your_jwt_secret_key # Must match auth-service
AUTH_SERVICE_URL=http://localhost:8080
ITEM_SERVICE_URL=http://localhost:8081
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
MAIL_USERNAME=your_gmail@gmail.com
MAIL_PASSWORD=your_app_passwordVITE_AUTH_SERVICE_URL=http://localhost:8080
VITE_ITEM_SERVICE_URL=http://localhost:8081
VITE_RENTAL_SERVICE_URL=http://localhost:8082Harsh
- 📧 h664363@gmail.com
- 📞 +91-9354530598
- 🔗 LinkedIn | GitHub
Built with ☕ Java, 🍃 Spring Boot & ⚛️ React