Skip to content

Madhavarora05/Vroom

Repository files navigation

Vroom - Vehicle Rental System

A comprehensive vehicle rental management system built with Spring Boot backend and React frontend.

πŸš€ Features

User Features

  • User Registration & Authentication: Secure user registration and login
  • Vehicle Browsing: Browse available vehicles with search and filter options
  • Real-time Availability: Check vehicle availability for specific dates
  • Booking Management: Make bookings and view booking history
  • Responsive Design: Mobile-friendly interface

Admin Features

  • Dashboard: Overview of bookings, users, and vehicles
  • Vehicle Management: Add, edit, and manage vehicle models and units
  • User Management: Manage user accounts and permissions
  • Booking Oversight: Monitor all bookings across the system

Technical Features

  • Session-based Authentication: Secure session management
  • RESTful APIs: Well-structured REST endpoints
  • Database Integration: MySQL database with JPA/Hibernate
  • Containerized Deployment: Docker and Docker Compose support
  • Production Ready: Optimized for production deployment

πŸ›  Technology Stack

Backend

  • Java 17
  • Spring Boot 3.5.3
  • Spring Security
  • Spring Data JPA
  • MySQL 8.0
  • Maven

Frontend

  • React 19.1.0
  • React Router DOM
  • Bootstrap 5.3.7
  • Axios
  • Lucide React Icons

DevOps

  • Docker & Docker Compose
  • Nginx
  • Maven
  • npm

πŸ“‹ Prerequisites

  • Docker (version 20.10 or higher)
  • Docker Compose (version 2.0 or higher)
  • Git

πŸš€ Quick Start

1. Clone the Repository

git clone <repository-url>
cd vroom

2. Deploy with Docker

# Make deploy script executable (Linux/Mac)
chmod +x deploy.sh

# Run deployment
./deploy.sh

3. Access the Application

4. Default Login Credentials

πŸ›  Manual Setup

Backend Setup

cd vehicle-rental-backend

# Using Maven
./mvnw clean install
./mvnw spring-boot:run

# Or using Docker
docker build -t vroom-backend .
docker run -p 8080:8080 vroom-backend

Frontend Setup

cd vehicle-rental-frontend

# Install dependencies
npm install

# Start development server
npm start

# Or build for production
npm run build

Database Setup

# Start MySQL container
docker run --name vroom-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=vehiclerental -p 3306:3306 -d mysql:8.0

πŸ“ Project Structure

vroom/
β”œβ”€β”€ vehicle-rental-backend/          # Spring Boot backend
β”‚   β”œβ”€β”€ src/main/java/com/vehicle/
β”‚   β”‚   β”œβ”€β”€ controller/              # REST controllers
β”‚   β”‚   β”œβ”€β”€ service/                 # Business logic
β”‚   β”‚   β”œβ”€β”€ model/                   # JPA entities
β”‚   β”‚   β”œβ”€β”€ repository/              # Data repositories
β”‚   β”‚   β”œβ”€β”€ config/                  # Configuration classes
β”‚   β”‚   └── dto/                     # Data transfer objects
β”‚   β”œβ”€β”€ src/main/resources/
β”‚   β”‚   β”œβ”€β”€ application.properties   # Development config
β”‚   β”‚   └── application-prod.properties # Production config
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── pom.xml
β”œβ”€β”€ vehicle-rental-frontend/         # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/              # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/                   # Page components
β”‚   β”‚   β”œβ”€β”€ context/                 # React context
β”‚   β”‚   β”œβ”€β”€ api/                     # API configuration
β”‚   β”‚   └── App.js                   # Main app component
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ nginx.conf
β”‚   └── package.json
β”œβ”€β”€ docker-compose.yml               # Multi-container setup
β”œβ”€β”€ deploy.sh                        # Deployment script
└── README.md

πŸ”§ API Endpoints

Authentication

  • POST /api/users/register - User registration
  • POST /api/users/login - User login
  • POST /api/users/logout - User logout
  • GET /api/users/profile - Get user profile

Vehicles

  • GET /api/users/car-models - Get all car models
  • GET /api/users/available-units - Get available units for dates

Bookings

  • POST /api/users/book - Create new booking
  • GET /api/users/my-bookings - Get user's bookings

Admin

  • GET /api/admin/users - Get all users
  • GET /api/admin/car-models - Get all car models
  • POST /api/admin/car-models - Add new car model

πŸ§ͺ Sample Data

The application comes with pre-loaded sample data:

Vehicles

  • Maruti Suzuki Swift (Hatchback) - β‚Ή1,800/day
  • Hyundai Creta (SUV) - β‚Ή3,500/day
  • Honda City (Sedan) - β‚Ή2,800/day
  • Mahindra Thar (SUV) - β‚Ή4,200/day
  • Toyota Innova Crysta (MPV) - β‚Ή4,800/day

Users

πŸ”§ Configuration

Environment Variables

Backend

  • SPRING_DATASOURCE_URL - Database URL
  • SPRING_DATASOURCE_USERNAME - Database username
  • SPRING_DATASOURCE_PASSWORD - Database password
  • CORS_ALLOWED_ORIGINS - CORS allowed origins

Frontend

  • REACT_APP_BACKEND_URL - Backend API URL

πŸš€ Deployment

Production Deployment

  1. Update environment variables in docker-compose.yml
  2. Set production database credentials
  3. Configure CORS origins for your domain
  4. Run ./deploy.sh

Cloud Deployment

  • AWS: Use ECS or EKS with RDS for database
  • Google Cloud: Use Cloud Run with Cloud SQL
  • Azure: Use Container Instances with Azure Database

πŸ§ͺ Testing

Backend Testing

cd vehicle-rental-backend
./mvnw test

Frontend Testing

cd vehicle-rental-frontend
npm test

πŸ“ Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ› Troubleshooting

Common Issues

  1. Database Connection Error

    • Ensure MySQL is running
    • Check database credentials
    • Verify database exists
  2. CORS Issues

    • Check CORS configuration in backend
    • Verify frontend URL in allowed origins
  3. Port Conflicts

    • Change ports in docker-compose.yml
    • Ensure ports 3000, 8080, 3306 are available
  4. Build Failures

    • Check Java version (requires Java 17)
    • Ensure Node.js version compatibility
    • Clear Maven/npm cache

Logs

# View all logs
docker-compose logs

# View specific service logs
docker-compose logs backend
docker-compose logs frontend
docker-compose logs mysql

πŸ“ž Support

For support and questions, please open an issue in the repository.


Happy Coding! πŸš—πŸ’¨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published