CarRental is a full-stack web application that connects car owners and renters on a single unified platform. Owners can list their vehicles, manage bookings, and track earnings — while customers can browse available cars, make reservations, and manage their rental history.
- Browse and search available rental cars
- View car details (specs, pricing, availability)
- Book a car for a custom date range
- Manage booking history and upcoming rentals
- List cars with photos, description, and pricing
- Accept or reject incoming booking requests
- Track rental status and earnings dashboard
- Manage your fleet from a dedicated owner panel
- JWT-based authentication (register / login)
- Role-based access control (customer vs. owner)
- Protected routes on both frontend and backend
- Responsive UI across all screen sizes
| Layer | Technology |
|---|---|
| Frontend | React.js, React Router, Axios, CSS / Tailwind |
| Backend | Node.js, Express.js |
| Database | MongoDB (Atlas) + Mongoose |
| Auth | JSON Web Tokens (JWT) |
| Deployment | Vercel (frontend), Render / Railway (backend) |
carRental/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── context/
│ │ └── App.jsx
│ └── package.json
│
├── server/ # Express backend
│ ├── models/
│ ├── routes/
│ ├── controllers/
│ ├── middleware/
│ └── index.js
│
└── .gitignore
- Node.js v18+
- MongoDB Atlas URI
- npm or yarn
git clone https://github.com/Aman739-code/carRental.git
cd carRentalcd server
npm installCreate a .env file in /server:
PORT=5000
MONGO_URI=your_mongodb_atlas_uri
JWT_SECRET=your_jwt_secretnpm startcd ../client
npm install
npm startThe app will run on http://localhost:3000 with the API on http://localhost:5000.
- Frontend is deployed on Vercel — push to
mainauto-deploys. - Backend can be deployed to Render, Railway, or any Node-compatible platform.
- Set the production API base URL in the client's environment variables:
REACT_APP_API_URL=https://your-backend-url.com
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.
- Fork the repo
- Create your feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
This project is open source and available under the MIT License.
Made with ❤️ by Aman Bhatnagar
⭐ Star this repo if you found it useful!