How iamaden/flight-ticket-booking-system works
Project Type & Purpose
• This is a full-stack web application built using Java Spring Boot for the backend and HTML/JavaScript/CSS for the frontend.
• Its purpose is to allow users to register/login, search for flights, book tickets, view booking history, edit bookings, and cancel bookings.
• The README also highlights the use of custom data structures (MyLinkedList and MyQueue) to manage certain aspects of the booking system.
File Structure
• The top-level folder (com.ft.flight) shows a Maven-based Java project structure (pom.xml, mvnw scripts) and follows the typical Spring Boot hierarchy: src/main/java, src/main/resources, and src/test.
• Under src/main/java, the package structure (com.ft.flight) is divided into:
• Application.java – the main entry point.
• controller (e.g., MainController.java): handles HTTP requests.
• entity (includes Booking, Flight, User, and the custom MyLinkedList & MyQueue classes): defines the data models.
• repository (BookingRepository, FlightRepository, UserRepository): data access layer.
• service (BookingService, EmailService, FlightService, UserService): holds business logic.
• The resources folder contains application.properties for configuration, static files (CSS, JS, images), and templates (HTML pages for different views).
• Additional directories like node_modules, package.json, and screenshots indicate some frontend dependencies and documentation screenshots.
System Components and Their Relationships
• Frontend: Built with static HTML, CSS, and JavaScript stored under src/main/resources/static and templates. This layer provides user interfaces (e.g., login, registration, flight search, booking form, etc.).
• Backend (Spring Boot Application):
• Controller Layer: Exposes endpoints (e.g., /login, /booking) to handle user requests.
• Service Layer: Implements business logic including handling bookings, email processing, and user management.
• Repository Layer: Provides data access to the database (likely via JPA, connected to a MySQL database).
• Entity Layer: Defines domain objects and incorporates customized data structures for specialized operations.
• Database: A MySQL database is used (as noted from the README with the phpMyAdmin MySQL reference) for persisting flight, booking, and user data.
• Custom Data Structures: The MyLinkedList and MyQueue classes indicate that some parts of booking handling or flight listing might leverage custom implementations.
Architectural Patterns & Design Principles
• The application follows a layered (or N-tier) architecture: presentation (frontend), controller, service, repository, and database.
• It leverages the MVC (Model-View-Controller) pattern where the template engine renders views served by controllers.
• The structure shows separation of concerns; each layer has a distinct role.
• The use of Maven, Spring Boot conventions, and packaging into clear modules emphasizes modularity and scalability.