The Vehicle Rental System is a web-based application designed to facilitate the rental of vehicles (cars, bikes, etc.) for users for a specific duration. The system is built with a microservices architecture, ensuring modularity and scalability. It provides separate functionalities for users and admins, with distinct dashboards for each role. Below is a summary of the project's working and flow, focusing on the must-have features and the three key points provided:
The system supports multiple users and a single admin.
Form validations and checks are implemented to ensure proper input.
Status codes and error handling are in place to manage login failures.
Role-Based Redirection:
If the user is a regular user, they are redirected to the User Dashboard.
If the user is an admin, they are redirected to the Admin Panel.
Admins can view all vehicle listings.
Admins can add a new vehicle to the system.
Booking Management:
Admins can view the booking history of all users.
User Management:
Admins can add a new user (register form) to the system.
Real-Time Availability Check:
Admins can ensure that vehicle availability is updated in real-time.
Users can browse all available vehicles.
Each vehicle listing has a book button for users to initiate a rental.
Booking Management:
Users can book a vehicle based on availability.
Users can view their booking history.
Real-Time Availability Check:
Users can see real-time updates on vehicle availability.
Must-Have Features: Vehicle Management for Admins:
Admins can add, view, and manage vehicle bookings.
Booking Management:
Users can book vehicles, and admins can manage these bookings.
Real-Time Availability Check:
Both users and admins can see real-time updates on vehicle availability.
Admin Panel:
A fully functional admin panel for managing vehicles, bookings, and users.
Database Schema Design:
A properly structured database (using PostgreSQL) to store user data, vehicle data, and booking information.
Technology Stack: Frontend: HTML, CSS, JavaScript (do not use any external thin like bootstrap)
Backend: Spring Boot 3.4.3 (Java version 17)
Database: PostgreSQL Start implementing the project using springboot and html,css and js and make sure that the app should have no issues. Careully read the SRS
Let's build a complete Vehicle Rental System with Spring Boot for the backend and HTML, CSS, and JavaScript for the frontend. I'll structure this implementation to cover all the requirements.
I've created a complete Vehicle Rental System with Spring Boot backend and HTML/CSS/JavaScript frontend. The system includes all the required features:
Models/Entities:
Repositories:
Services:
Controllers:
Security:
Login and Registration:
Admin Dashboard:
User Dashboard:
Responsive Design:
Vehicle Management:
Booking System:
User Management:
Real-time Updates:
Build and run the application using Maven:
mvn clean install
mvn spring-boot:run
Login with the default admin credentials:
The application uses PostgreSQL with the following schema:
Users Table:
Vehicles Table:
Bookings Table:
This implementation satisfies all the requirements specified in the SRS, providing a complete vehicle rental management system with separate functionalities for users and admins, real-time availability tracking, and comprehensive booking management.
Few points i want you to read and modify the code - 1. There is no security configuration required like hashed password. 2. You should use lombok for easy coding. 3. I want to do admin creation through postman. 4. Make sure frontend and backend should align well and properly function together.
I'll modify the Vehicle Rental System based on your requirements. Let me make the necessary changes to address each point.
I've modified the Vehicle Rental System based on your requirements. Here are the key changes:
Updated entity classes (User, Vehicle, Booking) with Lombok annotations:
/api/users/admin
for creating admin usershttp://localhost:8080/api/users/admin
{
"username": "youradmin",
"password": "yourpassword",
"fullName": "Admin User",
"email": "admin@example.com"
}
Build and run the application using Maven:
mvn clean install
mvn spring-boot:run
Login with the default admin credentials:
The application now has a simpler codebase with Lombok, no security configuration, and better alignment between frontend and backend. The admin creation through Postman is fully supported, and a default admin user is created on startup for convenience.