A secure, feature-rich online rental marketplace connecting users directly for tech equipment and item rentals.
- π¦ Rental Marketplace - Browse, search, and rent items with detailed listings
- πΊοΈ Location-Based Search - Interactive map with nearby rentals
- π¬ Real-Time Messaging - Direct communication between renters and listers
- πΈ Image Management - Google Drive integration with 2TB storage
- π Secure Authentication - Passport.js with local and OAuth strategies
-
π Delivery System
- Home delivery or self-pickup options
- Real-time delivery tracking with status updates
- Distance-based cost calculation
- Automatic status progression (shipped β en route β delivered)
-
β Dual Rating System
- Delivery ratings (delivery speed, item condition, communication)
- Owner ratings (overall experience)
- Aggregate ratings displayed on listings
-
π³ Payment Processing
- Rental payments with platform fee (10%)
- Delivery fee handling
- Transaction receipts
- Node.js >= 18.0.0
- PostgreSQL 14+
- Google Drive OAuth credentials (for image storage)
-
Clone the repository
git clone https://github.com/SmeetPatil/rent-sphere.git cd rent-sphere -
Install dependencies
# Install backend dependencies npm install # Install frontend dependencies cd client npm install cd ..
-
Configure environment variables
Create a
.envfile in the root directory:# Database DATABASE_URL=postgresql://user:password@host:port/database # Session SESSION_SECRET=your-session-secret # Google Drive OAuth (for image storage) GOOGLE_CLIENT_ID=your-client-id GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_REFRESH_TOKEN=your-refresh-token # Server PORT=8085
-
Initialize the database
node setup/initdb.js node setup/rental-tables-setup.js node setup/messaging-tables.js
-
Run the application
# Development mode (with hot reload) npm run dev # Production mode npm run project
-
Access the application
- Frontend: http://localhost:8085
- Backend API: http://localhost:8085/api
rent-sphere/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # React components
β β β βββ Dashboard/
β β β βββ Messaging/
β β β βββ Rentals/ # Rental, delivery, rating components
β β βββ App.js
β βββ build/ # Production build
βββ routes/ # Express API routes
β βββ api.routes.js
β βββ auth.routes.js
β βββ delivery-rating.routes.js
β βββ image.routes.js
β βββ messaging.routes.js
β βββ rental.routes.js
βββ auth/ # Authentication logic
β βββ passport.js
β βββ userService.js
βββ middleware/ # Express middleware
βββ services/ # Business logic
β βββ googleDriveService.js
β βββ simpleImageService.js
βββ setup/ # Database setup scripts
βββ public/ # Static files
βββ server.js # Express server entry point
- Runtime: Node.js
- Framework: Express.js
- Database: PostgreSQL (Neon)
- Authentication: Passport.js
- Session Management: express-session
- File Upload: Multer
- Storage: Google Drive API
- Framework: React
- Routing: React Router
- HTTP Client: Axios
- Maps: Leaflet (OpenStreetMap)
- Styling: CSS3
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/rentals- Get all listingsGET /api/rental/:id- Get listing detailsPOST /api/rentals- Create new listingPUT /api/rentals/:id- Update listingDELETE /api/rentals/:id- Delete listingPOST /api/rental-requests- Create rental request
POST /api/calculate-delivery-cost- Calculate delivery costPOST /api/choose-delivery-option- Select delivery methodPOST /api/pay-delivery- Process delivery paymentGET /api/delivery-tracking/:requestId- Get tracking infoGET /api/simulate-delivery-progress- Update delivery statuses
POST /api/rental-requests/:id/rate- Submit delivery ratingPOST /api/rental-requests/:id/rate-owner- Submit owner ratingGET /api/listings/:id/delivery-ratings- Get listing ratings
GET /api/conversations- Get user conversationsGET /api/conversations/:id/messages- Get messagesPOST /api/messages- Send message
# Test database connection
node setup/test-connection.js
# Reset delivery data (for testing)
node setup/reset-delivery-payments.js# Build frontend
cd client
npm run build
# Start production server
npm startRentSphere uses Google Drive for image storage with OAuth2 authentication.
-
Create Google Cloud Project
- Go to Google Cloud Console
- Create a new project
- Enable Google Drive API
-
Create OAuth Credentials
- Go to "Credentials" section
- Create OAuth 2.0 Client ID
- Add authorized redirect URIs
- Download credentials
-
Get Refresh Token
node services/get-refresh-token.js
-
Update .env file
GOOGLE_CLIENT_ID=your-client-id GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_REFRESH_TOKEN=your-refresh-token
- users - User accounts and authentication
- listings - Rental item listings
- rental_requests - Rental bookings and transactions
- delivery_events - Delivery tracking history
- delivery_ratings - Delivery experience ratings
- user_ratings - Owner/renter ratings
- conversations - Messaging conversations
- messages - Chat messages
See OVERVIEW.md for detailed schema documentation.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub: @SmeetPatil
- OpenStreetMap for map tiles
- Google Drive API for storage
- Neon for PostgreSQL hosting
- All contributors and users
For support, please open an issue on GitHub or contact the maintainer.
Made with β€οΈ by Smeet Patil