✈️ Airline Reservation System (Spring Boot + MySQL)
A full-featured Airline Reservation System built using Java Spring Boot and MySQL, featuring baggage charge calculation, seat management, and RESTful API endpoints for flight, passenger, and reservation operations.
🚀 Features
Core Functionality
- Flight Management – View and search available flights
- Reservation System – Book, view, and cancel reservations
- Passenger Management – Store and manage passenger details
- Baggage Management – Automatic baggage type detection and charge calculation
Baggage Pricing Rules
| Type | Weight Limit | Charge |
|---|
| Carry-on | Up to 7 kg | Free |
| Checked | Up to 23 kg | ₹400.00 |
| Overweight | Above 23 kg | ₹400.00 + ₹300.00 per excess kg |
- Automatically upgrades baggage type based on actual weight
- Displays detailed description and breakdown of charges
🏗️ Tech Stack
| Layer | Technology |
|---|
| Backend | Java 17, Spring Boot 3.2.0 |
| Database | MySQL 8.0 |
| ORM | Spring Data JPA (Hibernate) |
| Validation | Jakarta Bean Validation (JSR 380) |
| Build Tool | Maven |
🗄️ Database Schema Overview
- flights – Stores flight information and seat availability
- passengers – Stores passenger details
- reservations – Stores booking and payment details
- baggage – Stores baggage type, weight, and charge info
⚙️ Setup Instructions
Prerequisites
- Java 17 or higher
- MySQL 8.0 or higher
- Maven 3.6 or higher
Steps to Run
-
Clone the repository
-
Update database credentials in src/main/resources/application.properties
-
Run the application using the command:
mvn spring-boot:run
-
The app will start on: http://localhost:8080
🎮 Console Interface Options
- View All Available Flights
- Search Flights
- Make Reservation
- View Reservation
- Calculate Baggage Charge
- View All Reservations
- Cancel Reservation
- View Baggage Policy
- Exit
🌐 REST API Endpoints
- GET /api/flights – Fetch all available flights
- GET /api/flights/{id} – Get flight by ID
- GET /api/flights/search – Search flights by route
- POST /api/reservations – Create reservation
- GET /api/reservations/{id} – Get reservation by ID
- GET /api/reservations/code/{code} – Get reservation by code
- DELETE /api/reservations/{id} – Cancel reservation
- POST /api/baggage/calculate – Calculate baggage charges
💼 Baggage Policy Summary
- Carry-on: Up to 7 kg – Free
- Checked: Up to 23 kg – ₹400
- Overweight: Above 23 kg – ₹400 + ₹300 per excess kg
- Auto-upgrade system ensures correct type based on actual weight
🧱 Architecture Overview
| Pattern | Description |
|---|
| MVC | Model-View-Controller separation |
| Service Layer | Business logic encapsulation |
| Repository | Data access abstraction using Spring Data JPA |
| DTO | Clean API data transfer between frontend and backend |
🚧 Future Enhancements
- Payment gateway integration
- Email & SMS notifications
- Seat selection feature
- Multi-language support
- Web and mobile UI
- Loyalty & reward system
🧑💻 Author
Developed by Vipul Singh
Airline Reservation System – 2025