Skip to content

elyse502/car-rental

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAR RENTAL 🚖

Drive Your Dreams, Rent with Ease

Last Commit Languages License

Powered by cutting-edge technologies:

MongoDB Express React Node.js ImageKit JWT

LIVE - DEMO 🌐

Visit the 👉 LINK 🔗


Table of Contents


Overview

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.


Key Features

User Experience

  • Browse available cars with filters
  • View car details with high-quality images
  • Select pickup location and dates
  • Manage personal bookings
  • User profile management

Booking System

  • Real-time availability checking
  • Booking calendar
  • Confirmation notifications
  • Booking history
  • Cancellation option

Admin Dashboard

  • Add/Edit/Remove vehicles
  • Manage all bookings
  • View rental statistics
  • User management
  • Inventory control

Security & Performance

  • JWT authentication
  • Password encryption
  • Protected admin routes
  • Image optimization
  • Fast loading times

Tech Stack

Frontend

  • 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

Backend

  • Node.js with Express
  • MongoDB with Mongoose
  • JWT for authentication
  • Bcrypt for password hashing
  • ImageKit for media management
  • Multer for file uploads

DevOps

  • Vercel for frontend hosting
  • Render for backend hosting
  • GitHub Actions for CI/CD

Project Structure

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

Getting Started

Prerequisites

  • Node.js (v18+)
  • npm (v9+)
  • MongoDB Atlas account or local MongoDB
  • ImageKit account (for media storage)

Installation

  1. Clone the repository:
git clone https://github.com/elyse502/car-rental.git
cd car-rental
  1. Install dependencies for both client and server:
# Install client dependencies
cd client && npm install

# Install server dependencies
cd ../server && npm install
  1. Set up environment variables: Create .env files in both client and server directories.

Environment Variables

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=5000

Client (.env)

VITE_API_BASE_URL=http://localhost:5000
  1. Start the development servers:
# In one terminal (server)
cd server && npm run dev

# In another terminal (client)
cd client && npm run dev

Usage

For Customers

  1. Browse Cars: View available vehicles
  2. Select Dates: Choose pickup/return dates
  3. Book Vehicle: Complete booking process
  4. Manage Bookings: View/cancel reservations

For Admins

  1. Login: Access admin dashboard
  2. Manage Fleet: Add/edit/remove vehicles
  3. View Bookings: Monitor all reservations
  4. Analytics: View rental statistics

API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login user

Cars

Method Endpoint Description
GET /api/cars Get all cars
POST /api/cars Add new car (admin)
GET /api/cars/:id Get car details

Bookings

Method Endpoint Description
POST /api/bookings Create new booking
GET /api/bookings/user Get user bookings
DELETE /api/bookings/:id Cancel booking

Admin Features

  • 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

Deployment

Frontend

Deploy with Vercel

Backend

Deploy to Render, Vercel, or other Node.js hosting services with MongoDB connection.


Screenshots

HOME PAGE

alt text

ADMIN DASHBOARD

alt text


Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.


📞 Contact

For any questions or support, please contact:

LinkedIn @phenrysay pH-7


CAR-RENTAL - Your journey starts here! 🛣️✨

Made with ❤️ by Elysée NIYIBIZI

⬆ Back to Top

Releases

No releases published

Packages

 
 
 

Contributors

Languages