https://github.com/kundan-10/bus_reservation_system
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.
https://github.com/kundan-10/bus_reservation_system
jwt-authentication restful-api springboot springdatajpa springsecurity-jwt
Last synced: about 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/kundan-10/bus_reservation_system
- Owner: Kundan-10
- Created: 2025-02-10T03:33:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-12T09:37:45.000Z (about 1 year ago)
- Last Synced: 2025-07-03T13:06:25.873Z (12 months ago)
- Topics: jwt-authentication, restful-api, springboot, springdatajpa, springsecurity-jwt
- Language: Java
- Homepage: https://github.com/Kundan-10/Bus_Reservation_System
- Size: 135 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
```properties
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
```sh
# 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**:
- **Swagger UI:** [http://localhost:8888/swagger-ui/index.html](http://localhost:8888/swagger-ui/index.html)
- **API Root Endpoint:** `http://localhost:8888/`
## 🔗 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:**
```json
{
"email": "Admin@gmail.com",
"password": "Admin@123"
}
```
**Response:**
```json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCIsdfadfadrte...",
}
```
---
### User and User Login Controller
---


---
### Admin and Admin Login Controller
---


---
### Bus Controller
---

---
### Reservation Controller
---

---
### Route Controller
---

---
### Feedback Controller
---

---