Skip to content

Bus Reservation System built with Spring Boot, JSP, and MySQL featuring user booking, reservations, and admin management modules.

Notifications You must be signed in to change notification settings

somaakash/Bus-Reservation-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸšŒ Bus Reservation System

A Full Stack Web Application built using Spring Boot, Spring MVC, Spring Data JPA, JSP, and MySQL.

This project allows users to search buses, book tickets, manage reservations, and submit feedback.
Admins can manage routes, buses, view reservations, and monitor user feedback.


๐Ÿ“– Project Overview

The Bus Reservation System is a layered MVC-based web application developed to simulate a real-world bus booking platform.

The system contains two modules:

  • ๐Ÿ‘ค User Module
  • ๐Ÿ›  Admin Module

The project follows proper Spring Boot architecture and best practices.


๐Ÿ— Architecture

The application follows Layered MVC Architecture:

Controller Layer  โ†’  Service Layer  โ†’  Repository Layer  โ†’  Database
        โ†“
     JSP (View Layer)

๐Ÿ›  Technologies Used

  • Java 17
  • Spring Boot 5.0.1
  • Spring MVC
  • Spring Data JPA
  • Hibernate ORM
  • JSP & JSTL
  • MySQL 8.1.0
  • Maven
  • Tomcat (Embedded Server)

๐Ÿ—„ Database Tables

Entity Name Description
User Stores registered user details such as username, password, and profile information
Admin Stores administrator login credentials
Route Contains route details including source, destination, and distance
Bus Stores bus information such as bus name, type, seat capacity, price, and availability
Booking Temporary booking details created when a user books seats
Reservation Final confirmed booking records with status and booking date
Feedback Stores user feedback including journey date, ratings, and comments

๐Ÿ”— Entity Relationships

  • User โ†’ One-to-Many โ†’ Reservation
  • Bus โ†’ One-to-Many โ†’ Reservation
  • Reservation โ†’ Many-to-One โ†’ User
  • Reservation โ†’ Many-to-One โ†’ Bus
  • Feedback โ†’ Many-to-One โ†’ User
  • Feedback โ†’ Many-to-One โ†’ Bus

๐Ÿ‘ค User Module Features

  1. User Registration
  2. User Login
  3. Search Buses (From โ†’ To)
  4. Book a Ticket
  5. Available Buses and Booking Bus
  6. Booking Confirmation
  7. View My Reservations
  8. Cancel Reservation
  9. Submit Feedback

๐Ÿ”„ User Booking Flow

  1. User logs in
  2. Searches buses
  3. Clicks "Book"
  4. Enters seat count
  5. Reservation saved in database
  6. Seats updated automatically
  7. Redirected to success page
  8. Visible in "My Reservations"

๐Ÿ›  Admin Module Features

  1. Admin Login
  2. Add / Edit / Delete Routes
  3. Add / Delete Buses
  4. View All Reservations
  5. View User Feedback

๐Ÿš€ How To Run

1. Clone the repository

git clone https://github.com/your-username/bus-reservation-system.git

2. Create Database

CREATE DATABASE bus_reservation_system;

3. Update MySQL credentials

Edit:

src/main/resources/application.properties

4. Run the project

Using Maven:

mvn spring-boot:run

OR run main class from IDE.


5. Open in browser

http://localhost:7383

Common Issues Faced & Solutions

1. Whitelabel Error (404)

Cause:

  • Incorrect URL mapping

Fix:

  • Added proper @GetMapping in controller

2. Ambiguous Mapping Error

Cause:

  • Duplicate URL mappings

Fix:

  • Changed endpoint paths

3. Feedback Not Showing

Cause:

  • Incorrect model attribute name

Fix:

  • Used correct attribute name in JSP

4. Admin Not Seeing Reservations

Cause:

  • Service method not properly called

Fix:

model.addAttribute("reservations",
    reservationService.getAllReservations());

5.Unknown Database Error

Cause:

  • Database not created

Fix:

CREATE DATABASE bus_reservation_system;

๐Ÿ“š Concepts Implemented

  • Spring Boot MVC
  • Spring Data JPA
  • Hibernate ORM
  • JSP & JSTL
  • Session Management
  • CRUD Operations
  • Entity Relationships
  • MVC Architecture
  • Exception Handling
  • Debugging using logs
  • MySQL Integration

๐ŸŽจ UI Highlights

  • Modern Navigation Bar
  • Styled Login Forms
  • Dashboard UI
  • Responsive Tables
  • Hover Effects
  • Confirmation Dialogs
  • Clean Layout Design

Final Output

๐Ÿ  Home Page

๐Ÿ‘ค User Module โ€“ Login & Dashboard

๐Ÿ” Search & View Available Buses

๐ŸšŒ Ticket Booking Flow

๐Ÿ’ฌ Feedback System

๐Ÿ›  Admin Panel โ€“ Dashboard & Route Management

๐Ÿ›ฃ Admin โ€“ Edit Route & Bus Management

โœ Admin โ€“ Edit Bus


๐Ÿง  Learning Outcomes

Through this project:

  • Understood complete MVC architecture
  • Implemented full CRUD operations
  • Managed relational database mappings
  • Designed booking system logic
  • Debugged real-world Spring Boot errors
  • Built structured layered application
  • Improved frontend styling using JSP & CSS

๐Ÿ”ฎ Future Enhancements

  • Online Payment Integration
  • Graphical Seat Selection
  • JWT Authentication
  • Role-based Security
  • REST API Version
  • React Frontend
  • Docker Deployment
  • Cloud Deployment (AWS)

๐Ÿ“Œ Project Status

โœ… Fully Functional
โœ… User Module Working
โœ… Admin Module Working
โœ… Feedback Module Working
โœ… Reservation System Working
โœ… Database Integrated
โœ… Ready for Deployment


๐Ÿ‘จโ€๐Ÿ’ป Author

Developed by: P. Soma Akash
Java Full Stack Trainee at Codegnan


Acknowledgement

Grateful to my trainer Sathya Prakash sir for invaluable guidance and support throughout my Java Full Stack training.


โญ If You Like This Project

Give it a โญ on GitHub!

About

Bus Reservation System built with Spring Boot, JSP, and MySQL featuring user booking, reservations, and admin management modules.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages