A comprehensive vehicle rental management system built with Spring Boot backend and React frontend.
- 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
- 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
- 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
- Java 17
- Spring Boot 3.5.3
- Spring Security
- Spring Data JPA
- MySQL 8.0
- Maven
- React 19.1.0
- React Router DOM
- Bootstrap 5.3.7
- Axios
- Lucide React Icons
- Docker & Docker Compose
- Nginx
- Maven
- npm
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
- Git
git clone <repository-url>
cd vroom# Make deploy script executable (Linux/Mac)
chmod +x deploy.sh
# Run deployment
./deploy.sh- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- MySQL: localhost:3306
- Admin: [email protected] / admin123
- User: [email protected] / password123
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-backendcd vehicle-rental-frontend
# Install dependencies
npm install
# Start development server
npm start
# Or build for production
npm run build# Start MySQL container
docker run --name vroom-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=vehiclerental -p 3306:3306 -d mysql:8.0vroom/
βββ 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
POST /api/users/register- User registrationPOST /api/users/login- User loginPOST /api/users/logout- User logoutGET /api/users/profile- Get user profile
GET /api/users/car-models- Get all car modelsGET /api/users/available-units- Get available units for dates
POST /api/users/book- Create new bookingGET /api/users/my-bookings- Get user's bookings
GET /api/admin/users- Get all usersGET /api/admin/car-models- Get all car modelsPOST /api/admin/car-models- Add new car model
The application comes with pre-loaded sample data:
- 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
- Admin: [email protected] / admin123
- User: [email protected] / password123
SPRING_DATASOURCE_URL- Database URLSPRING_DATASOURCE_USERNAME- Database usernameSPRING_DATASOURCE_PASSWORD- Database passwordCORS_ALLOWED_ORIGINS- CORS allowed origins
REACT_APP_BACKEND_URL- Backend API URL
- Update environment variables in
docker-compose.yml - Set production database credentials
- Configure CORS origins for your domain
- Run
./deploy.sh
- AWS: Use ECS or EKS with RDS for database
- Google Cloud: Use Cloud Run with Cloud SQL
- Azure: Use Container Instances with Azure Database
cd vehicle-rental-backend
./mvnw testcd vehicle-rental-frontend
npm test- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
-
Database Connection Error
- Ensure MySQL is running
- Check database credentials
- Verify database exists
-
CORS Issues
- Check CORS configuration in backend
- Verify frontend URL in allowed origins
-
Port Conflicts
- Change ports in docker-compose.yml
- Ensure ports 3000, 8080, 3306 are available
-
Build Failures
- Check Java version (requires Java 17)
- Ensure Node.js version compatibility
- Clear Maven/npm cache
# View all logs
docker-compose logs
# View specific service logs
docker-compose logs backend
docker-compose logs frontend
docker-compose logs mysqlFor support and questions, please open an issue in the repository.
Happy Coding! ππ¨