The Bus Reservation System Portal is a robust and secure platform designed for seamless bus ticket booking. It features efficient CRUD operations, JWT-based authentication, Spring Security, and role-based access control, ensuring a smooth and secure user experience. 🚀
- Java 17+
- Spring Boot
- Spring Security (JWT Authentication)
- Spring Data JPA
- Hibernate
- MySQL
- Lombok
- Swagger API Documentation
- User Registration & Login (JWT-based authentication)
- Search for Available Buses based on routes and schedules
- Book a Ticket for a selected bus
- View Booking History and manage reservations
- Update User Profile
- Provide Feedback for completed trips
- Admin Authentication & Role-Based Access
- Manage Bus Information (Add, Update, Delete Bus details)
- Manage Routes (Add, Update, Delete Routes)
- View and Manage Users
- Access & Manage Reservations
- Moderate User Feedback
- Manage bus routes, including stops and distances
- Assign routes to specific buses
- Store bus details including bus type, capacity, operator, and schedule
- Assign buses to specific routes
- Allow users to book, cancel, and modify reservations
- Track reservation history and payment status
- Users can rate and review their journey experience
- Admin can moderate inappropriate reviews
- JWT-based authentication with role-based access control.
- Password encryption using BCrypt for security.
- Session management to prevent unauthorized access.
- Global Exception Handling for better API stability.
- Swagger UI Integration for interactive API testing.
- Java 17+
- MySQL Database
- Maven
Before running the API server, update the database configuration inside the application.properties file.
server.port=8888
spring.datasource.url=jdbc:mysql://localhost:3306/ibusdb
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
spring.security.jwt.secret=your_secret_key
spring.security.jwt.expiration=3600000# Clone the repository
git clone https://github.com/your-username/BusReservationSystemPortal.git
# Navigate to the project directory
cd BusReservationSystemPortal
# Build the project
mvn clean install
# Start the application
mvn spring-boot:runAPI documentation is available via Swagger UI:
- Swagger UI: http://localhost:8888/swagger-ui/index.html
- API Root Endpoint:
http://localhost:8888/
POST /auth/login- Authenticate and receive JWT token.POST /auth/register- Register a new user/ new Admin(Role Based).
Request:
{
"email": "Admin@gmail.com",
"password": "Admin@123"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCIsdfadfadrte...",
}






