Skip to content

victor2099/AutoBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 AutoBase

AutoBase is a modern, full-stack car rental application designed to streamline the vehicle booking process. Built entirely on the MERN stack, it provides a seamless user experience for customers looking to rent vehicles, alongside a powerful, protected administrative dashboard for managing the fleet, tracking bookings, and monitoring revenue.

✨ Key Features

For Users:

  • 🔍 Browse & Filter: View available cars dynamically with details on pricing, category, and specifications.
  • 📅 Real-time Availability: Prevent double-booking with overlapping date validation.
  • 🔐 Secure Authentication: JWT-based user registration and login.

For Administrators:

  • 📊 Admin Dashboard: High-level overview of system operations.
  • 🚘 Fleet Management: Add, edit, or remove vehicles from the database.
  • 🛡️ Role-Based Access Control (RBAC): Protected routes ensuring only authorized admins can modify fleet data.

🛠️ Tech Stack

Frontend:

Backend:

🚀 Getting Started

Follow these instructions to set up the project locally.

Prerequisites

  • Node.js installed on your machine.
  • A MongoDB cluster (Atlas) or local MongoDB instance.

Installation

  1. Clone the repository:
    git clone [https://github.com/your-username/AutoBase.git](https://github.com/your-username/AutoBase.git)
    cd AutoBase
  2. **Install Backend Dependencies:
    cd backend
    npm install
  3. **Install Frontend Dependencies:
    cd ../frontend/app
    npm install

Environment Variables

This project uses a unified backend .env file that is shared with the Vite frontend. Create a .env file in the /backend directory and add the following:

# Backend Variables (Hidden from Browser)
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key

# Frontend Variables (Exposed to Vite via VITE_ prefix)
VITE_API_URL=http://localhost:5000/api

Running the Application

Start the backend server:

cd backend
npm run dev

Start the frontend Vite server:

cd frontend/app
npm run dev

📂 Project Structure

The project follows a modular, separation-of-concerns architecture:

AutoBase/
├── backend/
│   ├── controllers/    # Route logic (authController, carController)
│   ├── middleware/     # JWT verification & admin checks
│   ├── models/         # Mongoose Database Schemas
│   ├── routes/         # Express API endpoints
│   └── index.js        # Entry point for the server
└── frontend/
    └── app/
        ├── src/
        │   ├── api/        # Axios utility functions
        │   ├── components/ # Reusable UI components
        │   ├── pages/      # Route pages (Home, AdminDashboard)
        │   └── App.jsx     # Main React application
        └── vite.config.js  # Vite configuration

About

AutoBase is a scalable, full-stack car rental platform built with the MERN stack. It features a dynamic React frontend powered by Vite, a secure Node.js/Express REST API, and a dedicated admin dashboard for real-time fleet and booking management.

Resources

License

Stars

Watchers

Forks

Contributors