Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

123 Commits
 
 
 
 
 
 

Repository files navigation

Bus Reservation System Portal REST API

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. 🚀

🛠 Tech Stack

  • Java 17+
  • Spring Boot
  • Spring Security (JWT Authentication)
  • Spring Data JPA
  • Hibernate
  • MySQL
  • Lombok
  • Swagger API Documentation

📌 Main Modules

🏷 User Module

  • 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 Module

  • 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

🚏 Route Module

  • Manage bus routes, including stops and distances
  • Assign routes to specific buses

🚌 Bus Module

  • Store bus details including bus type, capacity, operator, and schedule
  • Assign buses to specific routes

🎟 Reservation Module

  • Allow users to book, cancel, and modify reservations
  • Track reservation history and payment status

⭐ Feedback Module

  • Users can rate and review their journey experience
  • Admin can moderate inappropriate reviews

🚀 Advanced Features

🔐 Security & Authentication

  • JWT-based authentication with role-based access control.
  • Password encryption using BCrypt for security.
  • Session management to prevent unauthorized access.

📈 Additional Enhancements

  • Global Exception Handling for better API stability.
  • Swagger UI Integration for interactive API testing.

🚀 Installation & Run

⚙ Prerequisites

  • Java 17+
  • MySQL Database
  • Maven

🔧 Configuration

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

▶ Running the Application

# 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:run

📄 API Documentation

Swagger UI

API documentation is available via Swagger UI:

🔗 API Endpoints

🔑 Authentication Module (JWT-Based Security)

  • 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...",
}

User and User Login Controller


Screenshot (291)

Screenshot (292)


Admin and Admin Login Controller


Screenshot (290) Screenshot (285)


Bus Controller


Screenshot (286)


Reservation Controller


Screenshot (288)


Route Controller


Screenshot (289)


Feedback Controller


Screenshot (287)


About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages