A full-stack *Car Rental Web Application built using the MERN Stack (MongoDB, Express.js, React.js, Node.js). This platform allows users to browse cars, book rentals, and manage bookings, while the admin can manage cars and reservations.
π Live Website: https://car-rental-gamma-lime.vercel.app/
π¦ Repository: https://github.com/ujjawalsingh30/CarRental
- User Registration & Login
- JWT Authentication with Cookies
- Browse available cars
- View booking history
- Contact support
- Responsive UI with Toast Notifications
- Product Listing
- Product Images Upload
- Cloudinary Media Storage
- Stock & Price Handling
- Password Hashing with bcrypt
- JWT-based Authentication
- Secure Cookie Handling
- Stripe Checkout Integration
GreenCart is built as a real-world e-commerce system, not a UI-only demo.
carrental/
β
βββ client/ # Frontend (React + Vite)
β βββ node_modules/ # Project dependencies
β βββ public/ # Static files
β β
β βββ src/ # Main source folder
β β βββ assets/ # Images, icons, and static assets
β β βββ components/ # Reusable React components
β β βββ context/ # Global state management (React Context)
β β βββ pages/ # Application pages
β β β
β β βββ App.jsx # Main App component
β β βββ main.jsx # React entry point
β β βββ index.css # Global styles
β β
β βββ .env # Frontend environment variables
β βββ .gitignore # Git ignored files
β βββ eslint.config.js # ESLint configuration
β βββ index.html # Root HTML file
β βββ package.json # Frontend dependencies
β βββ README.md # Frontend documentation
β βββ vercel.json # Vercel deployment config
β βββ vite.config.js # Vite configuration
β
βββ server/ # Backend (Node.js + Express)
β βββ configs/ # Database and external service configurations
β βββ controllers/ # Business logic for APIs
β βββ middleware/ # Authentication and custom middleware
β βββ models/ # MongoDB schemas (Mongoose)
β βββ routes/ # API route definitions
β βββ node_modules/ # Backend dependencies
β β
β βββ .env # Backend environment variables
β βββ .gitignore # Git ignored files
β βββ package.json # Backend dependencies
β βββ package-lock.json # Dependency lock file
β βββ server.js # Main backend entry point
β
βββ README.md # Project documentation
- Passwords hashed using bcrypt
- JWT tokens stored in HTTP-only cookies
- Protected routes using middleware
- Product data stored in MongoDB
- Images uploaded using Multer
- Media hosted on ImageKit
These APIs handle user registration, login, and user-related operations.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/user/register |
Register a new user |
| POST | /api/user/login |
Login user |
| GET | /api/user/profile |
Get logged-in user profile |
These APIs allow car owners/admins to manage cars in the system.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/owner/add-car |
Add a new car |
| GET | /api/owner/cars |
Get all cars added by owner |
| PUT | /api/owner/update-car/:id |
Update car details |
| DELETE | /api/owner/delete-car/:id |
Delete a car |
Create a .env file inside server/:
##################################
# Database
##################################
MONGO_URI=your_mongodb_connection_string
##################################
# Authentication
##################################
JWT_SECRET=your_jwt_secret
##################################
# ImageKit
##################################
IMAGEKIT_PUBLIC_KEY = your_imagekit_public_key
IMAGEKIT_PRIVATE_KEY = your_imagekit_private_key
IMAGEKIT_URL_ENDPOINT = your_imagekit_url_endpoint
##################################
.env files to GitHub.
cd server
npm install
npm run server
cd client
npm install
npm run dev
- Admin Dashboard
- Add new cars
- Update car details -Delete cars
- View all bookings
- Manage cars
- Role-based Access (Admin / User)
π Cars
This page displays all available cars for rent in a card-based layout. Each card shows important details such as
- Car brand and model
- Rental price per day
- Seating capacity
- Transmission type
- Fuel type
- Location
The My Bookings page allows users to track all their reservations. It shows:
- Booking ID
- Rental period
- Pickup location
- Booking status (Pending / Confirmed / Cancelled)
- Total price This helps users easily manage and review their bookings.
π Admin-Dashboard
The Admin Dashboard provides an overview of the platform's activity including:
- Total number of cars
- Total bookings
- Pending requests
- Confirmed bookings
- Recent booking activities
- Monthly revenue It helps administrators monitor platform performance efficiently.
β Add New Car
Admins can add new vehicles to the platform by filling in detailed information such as:
- Brand and model
- Year of manufacture
- Daily rental price
- Transmission type
- Fuel type
- Seating capacity
- Location
- Vehicle description
- Car image upload This ensures that all necessary vehicle details are available for customers.
π Manage Bookings
The Manage Bookings section allows administrators to control all customer reservations. Admins can:
- View all booking records
- Check payment status
- Approve or cancel bookings
- Update booking status This functionality ensures smooth booking management for the platform.
CarRental is a production-style vehicle booking platform built with the MERN stack, featuring user authentication, car management, booking functionality, and secure backend APIs.





