A comprehensive enterprise-grade vehicle fleet and rental management system built with Java 17, Spring MVC, Hibernate, and Swing.
- Java 17 - Core programming language
- Spring MVC 5.3.30 - Web framework
- Spring Core - Dependency Injection & IoC
- Spring ORM - Hibernate integration
- Hibernate 5.6.15 - ORM framework with JPA annotations
- MySQL 8.0 - Database (via XAMPP)
- JDBC - Database connectivity
- Maven - Build automation
- JSP - Server-side rendering
- JSTL - JSP Standard Tag Library
- Bootstrap 5 - CSS framework
- Bootstrap Icons - Icon library
- HTML5/CSS3/JavaScript - Core web technologies
- Java Swing - GUI framework for admin desktop app
- Jetty 9.4 - Embedded servlet container
smart-vehicle-fleet/
├── pom.xml
├── README.md
├── sql/
│ └── schema.sql
├── src/
│ └── main/
│ ├── java/
│ │ └── com/fleet/
│ │ ├── model/ # Entity classes
│ │ ├── dao/ # Data Access Layer
│ │ ├── service/ # Business Logic Layer
│ │ ├── controller/ # Spring MVC Controllers
│ │ └── swing/ # Swing Desktop App
│ ├── resources/
│ │ └── hibernate.cfg.xml
│ └── webapp/
│ ├── WEB-INF/
│ │ ├── web.xml
│ │ ├── dispatcher-servlet.xml
│ │ └── views/ # JSP pages
│ └── resources/
│ ├── css/
│ └── js/
- ✅ User Registration & Authentication
- ✅ Browse Available Vehicles
- ✅ Search & Filter Vehicles
- ✅ Vehicle Details View
- ✅ Book Vehicles with Date Selection
- ✅ View Booking History
- ✅ Cancel Bookings
- ✅ Responsive UI with Bootstrap 5
- ✅ Admin Login
- ✅ Add New Vehicles
- ✅ Update Vehicle Information
- ✅ Delete Vehicles
- ✅ View All Vehicles
- ✅ Toggle Vehicle Status (Available/Booked)
- ✅ View All Bookings
- ✅ Modern Swing UI
- users - Customer information
- vehicles - Vehicle inventory
- bookings - Rental bookings
- admins - Administrator accounts
- Java 17 JDK installed
- Maven 3.6+ installed
- XAMPP with MySQL running
- Git (optional)
- Start XAMPP and ensure MySQL is running
- Open phpMyAdmin or MySQL command line
- Run the SQL script:
mysql -u root -p < sql/schema.sqlOr manually:
- Create database:
fleet_management - Execute the SQL statements in
sql/schema.sql
The default configuration uses:
- Host: localhost:3306
- Database: fleet_management
- Username: root
- Password: (empty)
To change these, edit:
src/main/webapp/WEB-INF/dispatcher-servlet.xmlsrc/main/resources/hibernate.cfg.xml
mvn clean installmvn jetty:runThe application will start at: http://localhost:8080/fleet
In a new terminal:
mvn exec:java "-Dexec.mainClass=com.fleet.swing.AdminLogin"- Username: admin
- Password: admin123
OR
- Username: nancy29
- Password: nancy29
- Username: admin
- Password: admin123
OR
- Username: manager
- Password: manager123
| Page | URL |
|---|---|
| Login | http://localhost:8080/fleet/login |
| Register | http://localhost:8080/fleet/register |
| Home | http://localhost:8080/fleet/home |
| Vehicles | http://localhost:8080/fleet/vehicles |
| My Bookings | http://localhost:8080/fleet/myBookings |
- Modern, clean Bootstrap 5 design
- Responsive layout for all devices
- Card-based vehicle display
- Real-time booking calculations
- Professional color scheme
- Interactive hover effects
- Alert notifications
- Form validation
- Clean, modern interface
- Sidebar navigation
- Table-based data display
- Modal dialogs for confirmations
- Color-coded buttons
- Professional styling
┌─────────────┐
│ Controllers │ ← Spring MVC Controllers
└──────┬──────┘
│
┌──────▼──────┐
│ Services │ ← Business Logic (@Service)
└──────┬──────┘
│
┌──────▼──────┐
│ DAOs │ ← Data Access Layer (@Repository)
└──────┬──────┘
│
┌──────▼──────┐
│ Hibernate │ ← ORM Layer
└──────┬──────┘
│
┌──────▼──────┐
│ MySQL │ ← Database
└─────────────┘
- Spring MVC: 5.3.30
- Spring ORM: 5.3.30
- Hibernate Core: 5.6.15.Final
- MySQL Connector: 8.0.33
- JSTL: 1.2
- Servlet API: 4.0.1
- Jetty Maven Plugin: 9.4.51- Password storage (Note: Use BCrypt in production)
- Session management
- Input validation (client & server-side)
- SQL injection prevention via Hibernate HQL
- CSRF protection (can be enhanced)
mvn clean packageDeploy the generated WAR file (target/smart-vehicle-fleet.war) to any servlet container.
mvn jetty:run- Create entity in
model/package - Create DAO interface and implementation
- Create Service interface and implementation
- Create Controller with request mappings
- Create JSP view
- Update navigation
- Hibernate is set to
updatemode - Changes to entities auto-update schema
- For production, use migration tools
# Kill process on port 8080
lsof -ti:8080 | xargs kill -9 # Mac/Linux
netstat -ano | findstr :8080 # Windows- Ensure MySQL is running
- Check credentials in config files
- Verify database exists
- Check entity mappings
- Verify foreign key relationships
- Check transaction boundaries
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is created for educational purposes.
Nancy Sangani
Happy Coding! 🚗💨