- Overview
- Key Features
- Tech Stack
- Project Structure
- Getting Started
- Usage
- API Endpoints
- Admin Features
- Deployment
- Screenshots
- Contributing
- License
CAR-RENTAL is a full-featured vehicle rental platform that provides:
- 🚘 Extensive car inventory with filters
- 📅 Flexible booking system with date selection
- 🔐 Secure user authentication
- 📱 Responsive design for all devices
- 👨💼 Admin dashboard for fleet management
- 🖼️ Optimized media delivery with ImageKit
Designed to simplify the car rental process for both customers and administrators.
- Browse available cars with filters
- View car details with high-quality images
- Select pickup location and dates
- Manage personal bookings
- User profile management
- Real-time availability checking
- Booking calendar
- Confirmation notifications
- Booking history
- Cancellation option
- Add/Edit/Remove vehicles
- Manage all bookings
- View rental statistics
- User management
- Inventory control
- JWT authentication
- Password encryption
- Protected admin routes
- Image optimization
- Fast loading times
- React with Vite
- Context API for state management
- Axios for HTTP requests
- Tailwind CSS for styling
- React Icons for beautiful icons
- Date-fns for date handling
- Node.js with Express
- MongoDB with Mongoose
- JWT for authentication
- Bcrypt for password hashing
- ImageKit for media management
- Multer for file uploads
- Vercel for frontend hosting
- Render for backend hosting
- GitHub Actions for CI/CD
car-rental/
├── client/ # Frontend application
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── assets/ # Images, icons
│ │ ├── components/ # Reusable components
│ │ │ ├── owner/ # Admin components
│ │ │ │ ├── Login.jsx
│ │ │ │ ├── NavbarOwner.jsx
│ │ │ │ └── SideBar.jsx
│ │ │ ├── Banner.jsx
│ │ │ ├── CarCard.jsx
│ │ │ ├── FeaturedSection.jsx
│ │ │ └── ... # Other components
│ │ ├── context/ # Global state
│ │ ├── pages/ # Route pages
│ │ │ ├── owner/ # Admin pages
│ │ │ │ ├── AddCar.jsx
│ │ │ │ ├── Dashboard.jsx
│ │ │ │ └── ...
│ │ │ ├── CarDetails.jsx
│ │ │ ├── Cars.jsx
│ │ │ └── Home.jsx
│ │ └── ... # Other config files
│
├── server/ # Backend application
│ ├── configs/ # Configuration files
│ │ ├── db.js # Database config
│ │ └── imageKit.js # ImageKit config
│ ├── controllers/ # Business logic
│ │ ├── bookingController.js
│ │ ├── ownerController.js
│ │ └── userController.js
│ ├── middleware/ # Middlewares
│ │ ├── auth.js
│ │ └── multer.js
│ ├── models/ # Database models
│ │ ├── Booking.js
│ │ ├── Car.js
│ │ └── User.js
│ ├── routes/ # API routes
│ │ ├── bookingRoutes.js
│ │ ├── ownerRoutes.js
│ │ └── userRoutes.js
│ └── ... # Other server files- Node.js (v18+)
- npm (v9+)
- MongoDB Atlas account or local MongoDB
- ImageKit account (for media storage)
- Clone the repository:
git clone https://github.com/elyse502/car-rental.git
cd car-rental- Install dependencies for both client and server:
# Install client dependencies
cd client && npm install
# Install server dependencies
cd ../server && npm install- Set up environment variables:
Create
.envfiles in bothclientandserverdirectories.
Server (.env)
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key
IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key
IMAGEKIT_URL_ENDPOINT=your_imagekit_endpoint
PORT=5000Client (.env)
VITE_API_BASE_URL=http://localhost:5000- Start the development servers:
# In one terminal (server)
cd server && npm run dev
# In another terminal (client)
cd client && npm run dev- Browse Cars: View available vehicles
- Select Dates: Choose pickup/return dates
- Book Vehicle: Complete booking process
- Manage Bookings: View/cancel reservations
- Login: Access admin dashboard
- Manage Fleet: Add/edit/remove vehicles
- View Bookings: Monitor all reservations
- Analytics: View rental statistics
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register new user |
| POST | /api/auth/login | Login user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/cars | Get all cars |
| POST | /api/cars | Add new car (admin) |
| GET | /api/cars/:id | Get car details |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/bookings | Create new booking |
| GET | /api/bookings/user | Get user bookings |
| DELETE | /api/bookings/:id | Cancel booking |
-
Vehicle Management
- Add new cars with specifications
- Edit existing vehicle details
- Remove vehicles from inventory
-
Booking Oversight
- View all bookings
- Filter bookings by date/status
- Manage booking approvals
-
User Management
- View registered users
- Monitor user activity
- Handle support requests
Deploy to Render, Vercel, or other Node.js hosting services with MongoDB connection.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
For any questions or support, please contact:
- NIYIBIZI Elysée👨🏿💻 | Github | Linkedin | Twitter.
- Email: elyseniyibizi502@gmail.com

