# harismuneer/flight-booking-system-javaservlets_app architecture

> Architecture diagram of the GitHub repository harismuneer/flight-booking-system-javaservlets_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harismuneer/flight-booking-system-javaservlets_app
- Repository: https://github.com/harismuneer/flight-booking-system-javaservlets_app

## Overview

##### Main Components
- Frontend / Presentation Layer: This includes JSP pages, HTML/CSS/JavaScript assets, and the UI templates found under the “build/web”, “web”, and “assets” directories. These are what the end-users (Admins, Managers, Customers) interact with.
- Application / Business Layer:
- Java Servlets and Managers (see files such as CustomerManager.java, LoginManager.java, LogoutManager.java, etc. located in the src/java directory).
- The controllers (servlets), model classes, and filters (e.g., SecurityFilter.java, XSSFilter.java) that implement the core logic and validations.
- Data Layer: The Microsoft Access Database (notably, files such as airlines.accdb present in the project) and any persistence logic interacting with it.
- Security Components: Highlight the use of Tomcat Roles for authentication/authorization and the implemented security filters to prevent SQL Injection and XSS. Indicate distinct user roles (Airline Admin, Airline Manager, Customer).

##### Relationships and Data Flow
- How the Servlets interact with the Model components (for instance, invoking methods on Customer, Flight, and Seat models).
- Connection between the Business Layer and the Data Layer, indicating database read/write operations (Microsoft Access).
- Security checkpoints (e.g., filters executing before servlets) to intercept input data.

##### Architectural Patterns and Design Principles
- MVC Pattern: Clearly separate the view (JSPs), controller (Java Servlets, Managers), and model (Java classes representing business entities).
- Layered Architecture: Present the system as distinct layers (presentation, business, data, and integration service layer).

##### Relevant Technologies and Libraries
- Frontend technologies: HTML, CSS, JavaScript, jQuery, Bootstrap, and JSPs.
- Server-side: Java Servlets, Java Models, and filters.
- Database: Microsoft Access.
- Web Services: SOAP implemented using JAX-WS (with provided libraries like webservices-api.jar and related JARs).
- Security: Tomcat security via role-based access, along with internal security filters to mitigate SQL Injection and XSS risks.
- Build Tools: Use of Ant scripts (build.xml) and NetBeans project configurations.

##### Elements
- Labels for each component (e.g., "Presentation Layer (JSPs and Assets)", "Controllers/Managers (Servlets, Java logic)", "Model (Entities and Business Objects)", "Database (MS Access)", "Security (Filters, Tomcat Roles)", "SOAP Web Services (PriceAndSeats)".
- HTTP request flow from users through JSP pages to Servlets.
- Data operations between Servlets and the Database.
- Service calls to the external SOAP Web Services.

- Configuration or intermediary elements such as the use of filters for security that run before the request reaches business components.
- That the representation of external services (WSTester and SOAP Web Services) is visually distinct to emphasize that they are separate from the main application logic.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser initiating request
    Browser["User Browser"]:::presentation

    %% Presentation Layer
    subgraph "Presentation Layer (JSPs & Assets)"
        PPT["Primary Web Pages & Templates"]:::presentation
        BWA["Built Web Assets"]:::presentation
    end

    %% Security Components
    subgraph "Security Components"
        SF["Security Filters & Tomcat Roles"]:::security
    end

    %% Application/Business Layer
    subgraph "Application/Business Layer"
        BM["Java Servlets & Managers"]:::business
    end

    %% Data Layer
    subgraph "Data Layer"
        DB1["MS Access Database (Source)"]:::database
        DB2["MS Access Database (Built Classes)"]:::database
    end

    %% External SOAP Web Services Integration
    subgraph "Web Services Integration"
        SOAP["SOAP Web Services (PriceAndSeats)"]:::external
        WS_Tester["WSTester (Web Service Testing)"]:::external
    end

    %% Data Flow
    Browser -->|"HTTP Request"| PPT
    PPT -->|"Loads assets"| BWA
    PPT -->|"Forwards request"| SF
    SF -->|"Passes secure request"| BM
    BM -->|"Performs CRUD"| DB1
    BM -->|"Performs CRUD"| DB2
    BM -->|"Calls SOAP service"| SOAP
    SOAP -->|"Test/Validate"| WS_Tester
    WS_Tester -->|"Returns result"| SOAP
    SOAP -->|"Response data"| BM

    %% Click Events
    click PPT "https://github.com/harismuneer/flight-booking-system-javaservlets_app/tree/master/Project/TurkishAirlines/web/"
    click BWA "https://github.com/harismuneer/flight-booking-system-javaservlets_app/tree/master/Project/TurkishAirlines/build/web"
    click BM "https://github.com/harismuneer/flight-booking-system-javaservlets_app/tree/master/Project/TurkishAirlines/src/java"
    click DB1 "https://github.com/harismuneer/flight-booking-system-javaservlets_app/blob/master/Project/TurkishAirlines/src/java/airlines.accdb"
    click DB2 "https://github.com/harismuneer/flight-booking-system-javaservlets_app/blob/master/Project/TurkishAirlines/build/web/WEB-INF/classes/airlines.accdb"
    click SOAP "https://github.com/harismuneer/flight-booking-system-javaservlets_app/blob/master/Project/TurkishAirlines/src/java/webservices/PriceAndSeats.java"
    click WS_Tester "https://github.com/harismuneer/flight-booking-system-javaservlets_app/tree/master/Project/WSTester"
    click SF "https://github.com/harismuneer/flight-booking-system-javaservlets_app/tree/master/Project/TurkishAirlines/src/java/filters"

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef business fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef database fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef external fill:#e1bee7,stroke:#6a1b9a,stroke-width:2px;
    classDef security fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
