A complete, production-ready full-stack luxury vehicle rental platform built with React, Node.js, Express, MongoDB, and Tailwind CSS.
RideHub now features a premium luxury design:
- β¨ Dark Theme: Black backgrounds with gold accents
- π Smooth Animations: Framer Motion throughout
- π± Glass-morphism UI: Modern transparent effects
- β‘ Sticky Navigation: Transparent to solid on scroll
- π― Premium Typography: Montserrat + Inter fonts
- π Curved Cards: Luxury vehicle showcases
- π Animated Counters: 7600+ customers, 500+ vehicles
- πͺ Showroom Section: Mumbai, Delhi, Bangalore
- π± App Download: Google Play + App Store buttons
Design Inspiration: BigBoyToyz + BMW
- π Sign up & login with JWT authentication
- π Browse scooters, bikes, and cars by city, type, price, and category
- π Find nearby rental shops using geolocation
- π Book vehicles for specific date ranges
- π³ Pay online (Stripe or mock payment)
- π View booking history and payment records
- β Cancel bookings
- πͺ Register as shop owner with shop details
- π Add/edit/delete vehicles with multiple photos
- π° Set custom daily and hourly rental rates
- π Manage bookings for their shop
- π£οΈ Record start & end odometer readings
- π View shop statistics (revenue, bookings, distance)
- π₯ Track customers and booking history
- π¨βπΌ Manage users, shops, vehicles, and bookings
- Node.js + Express - REST API server
- MongoDB + Mongoose - Database with geospatial queries
- JWT - Authentication
- Multer - Image uploads
- Stripe - Payment integration (optional)
- bcrypt - Password hashing
- React 18 - UI library
- React Router - Client-side routing
- Tailwind CSS - Modern styling
- Axios - HTTP client
- React Toastify - Notifications
- React Icons - Icon library
- date-fns - Date formatting
- Node.js (v14 or higher)
- MongoDB (local or Atlas)
- npm or yarn
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create environment file:
Create a
.envfile in the backend directory:
cp .env.example .env- Configure environment variables:
Edit
.envfile:
# Server
PORT=5000
NODE_ENV=development
# Database
MONGO_URI=mongodb://localhost:27017/ridehub
# JWT
JWT_SECRET=your_super_secret_jwt_key_change_this
JWT_EXPIRE=30d
# Cloudinary (required for production image uploads)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Razorpay (optional - for real payments)s)
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_secret
# Payment Mode (razorpay or mock)
PAYMENT_MODE=mock- Start MongoDB:
# If using local MongoDB
mongod- Seed the database (Optional):
npm run seedThis will create:
- Sample users (admin, shop owners, customers)
- Demo shops in major cities
- Sample vehicles across categories
- Start the backend server:
npm run devBackend will run on http://localhost:5000
- Open a new terminal and navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Create environment file:
Create a
.envfile in the frontend directory:
REACT_APP_API_URL=http://localhost:5000/api- Start the development server:
npm startFrontend will open at http://localhost:3000
-
Sign Up / Login:
- Go to Register page
- Select "Customer" role
- Fill in your details
- Login with credentials
-
Browse Vehicles:
- Use the homepage search
- Filter by type, city, price range
- View vehicle details with image carousel
-
Book a Vehicle:
- Select dates and rental type (daily/hourly)
- Review total amount
- Click "Book Now"
- Complete payment
-
Manage Bookings:
- View all bookings in dashboard
- Track booking status
- Cancel if needed
-
Register Your Shop:
- Select "Shop Owner" during registration
- Provide shop details including:
- Shop name and address
- City and pincode
- GPS coordinates (latitude/longitude)
-
Add Vehicles:
- Go to Shop Dashboard
- Click "Add Vehicle"
- Fill vehicle details:
- Name, brand, type
- Engine capacity (CC)
- Transmission, fuel type
- Daily and hourly rates
- Upload multiple images
- Add features
-
Manage Bookings:
- View all bookings for your shop
- Update booking status
- Record odometer readings:
- Start reading at pickup
- End reading at return
- System auto-calculates distance traveled
-
View Analytics:
- Total bookings and revenue
- Vehicle utilization
- Distance statistics
POST /api/auth/register - Register new user
POST /api/auth/login - Login
GET /api/auth/me - Get current user
PUT /api/auth/updatedetails - Update profile
PUT /api/auth/updatepassword - Change password
GET /api/shops - Get all shops (with filters)
GET /api/shops/:id - Get single shop
POST /api/shops - Create shop (shop_owner)
PUT /api/shops/:id - Update shop (shop_owner)
DELETE /api/shops/:id - Delete shop (shop_owner)
GET /api/shops/me/myshop - Get my shop (shop_owner)
GET /api/vehicles - Get all vehicles
GET /api/vehicles/:id - Get single vehicle
POST /api/vehicles - Create vehicle (shop_owner)
PUT /api/vehicles/:id - Update vehicle (shop_owner)
DELETE /api/vehicles/:id - Delete vehicle (shop_owner)
GET /api/vehicles/shop/myvehicles - Get my shop vehicles
POST /api/vehicles/:id/check-availability - Check availability
POST /api/bookings - Create booking (customer)
GET /api/bookings/my - Get my bookings (customer)
GET /api/bookings/shop - Get shop bookings (shop_owner)
GET /api/bookings/:id - Get single booking
PUT /api/bookings/:id/status - Update status (shop_owner)
PUT /api/bookings/:id/record-odo - Record odometer (shop_owner)
PUT /api/bookings/:id/cancel - Cancel booking (customer)
GET /api/bookings/shop/stats - Get shop stats (shop_owner)
POST /api/payments/create - Create payment
POST /api/payments/confirm - Confirm payment
GET /api/payments/my - Get my payments
GET /api/payments/booking/:id - Get payment by booking
GET /api/payments/:id - Get payment details
- Auto-sliding image galleries
- Smooth transitions with fade effects
- Dot indicators and navigation arrows
- Mobile responsive
- MongoDB 2dsphere index
- Find shops within radius
- Latitude/longitude support
- Prevents overlapping bookings
- Calculates rental duration
- Supports hourly and daily rates
- Date validation
- Record start/end readings
- Auto-calculate distance
- Update vehicle total km
- Track per-booking usage
- Mock payment mode (default)
- Stripe integration ready
- Payment status tracking
- Booking confirmation on payment
- Mobile-first approach
- Tailwind CSS utilities
- Smooth animations
- Loading states
Mock Payment (Default):
PAYMENT_MODE=mock- Instant payment success
- No external dependencies
- Perfect for development
Razorpay Payment:
PAYMENT_MODE=razorpay
RAZORPAY_KEY_ID=your_key_id
RAZORPAY_KEY_SECRET=your_secret- Real payment processing
- Test mode available
- Indian payment gateway
Cloudinary (Production - Currently Configured):
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret- Images stored in cloud
- Automatic transformations (1200x800)
- Persistent storage across deployments
- CDN delivery for fast loading
Shop owners can set:
- Daily rates - Per 24-hour period
- Hourly rates - For short rentals
- Both - Customers choose preference
- Homepage - Hero section with search
- Vehicle Listing - Grid with filters
- Vehicle Detail - Full specs + booking form
- Dashboard - Track all bookings
- Payment - Secure checkout
- Registration - With shop details
- Dashboard - Stats & overview
- Add Vehicle - Multi-image upload
- Manage Bookings - Status updates
- Odometer Entry - Track usage
- Push code to GitHub
- Connect repository to Render
- Set environment variables:
- NODE_ENV=production
- PORT=5000
- MONGO_URI (MongoDB Atlas)
- JWT_SECRET
- JWT_EXPIRE
- CLOUDINARY_CLOUD_NAME
- CLOUDINARY_API_KEY
- CLOUDINARY_API_SECRET
- RAZORPAY_KEY_ID
- RAZORPAY_KEY_SECRET
- PAYMENT_MODE
- Auto-deploy on GitHub push
- Push code to GitHub
- Connect repository to Vercel
- Set environment variable:
- REACT_APP_API_URL (your Render backend URL)
- Auto-deploy on GitHub push
- Create cluster
- Whitelist IPs (0.0.0.0/0 for production)
- Create database user
- Update MONGO_URI in backend environment variables
- Register as a new customer or use seeded data
- Browse available vehicles
- Book a vehicle with date selection
- Complete mock payment
- Login as shop owner
- View booking in shop dashboard
- Update booking status
- Record odometer readings
# Check if MongoDB is running
mongo --version
mongod
# Or use MongoDB Atlas connection string
MONGO_URI=mongodb+srv://user:pass@cluster.mongodb.net/ridehub# Change port in .env
PORT=5001- Ensure backend CORS is enabled
- Check API_URL in frontend .env
- Verify ports match
# Clear and reseed database
npm run seed -- -d # Delete data
npm run seed # Import fresh dataridehub/
βββ backend/
β βββ config/
β β βββ db.js
β βββ controllers/
β β βββ authController.js
β β βββ shopController.js
β β βββ vehicleController.js
β β βββ bookingController.js
β β βββ paymentController.js
β βββ middleware/
β β βββ auth.js
β β βββ error.js
β β βββ upload.js
β βββ models/
β β βββ User.js
β β βββ Shop.js
β β βββ Vehicle.js
β β βββ Booking.js
β β βββ Payment.js
β βββ routes/
β β βββ authRoutes.js
β β βββ shopRoutes.js
β β βββ vehicleRoutes.js
β β βββ bookingRoutes.js
β β βββ paymentRoutes.js
β βββ .env
β βββ package.json
β βββ seeder.js
β βββ server.js
β
βββ frontend/
βββ public/
βββ src/
β βββ components/
β β βββ Navbar.js
β β βββ Footer.js
β β βββ ImageCarousel.js
β β βββ Loading.js
β β βββ PrivateRoute.js
β βββ context/
β β βββ AuthContext.js
β βββ pages/
β β βββ Home.js
β β βββ Login.js
β β βββ Register.js
β β βββ VehicleList.js
β β βββ VehicleDetail.js
β β βββ customer/
β β β βββ CustomerDashboard.js
β β βββ shop/
β β βββ ShopOwnerDashboard.js
β βββ services/
β β βββ api.service.js
β βββ utils/
β β βββ api.js
β βββ App.js
β βββ index.css
β βββ index.js
βββ .env
βββ package.json
βββ tailwind.config.js
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
Built with β€οΈ for the Indian vehicle rental market.
β
Multi-role authentication (Customer, Shop Owner, Admin)
β
Shop registration with geolocation
β
Vehicle CRUD with image uploads
β
Advanced search and filters
β
Real-time booking validation
β
Hourly and daily rental options
β
Odometer tracking system
β
Payment integration (Mock/Stripe)
β
Responsive UI with Tailwind CSS
β
Dynamic image carousels
β
Toast notifications
β
Loading states
β
Error handling
β
Database seeder
β
Production-ready architecture
Happy Renting! πποΈπ΅