# trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service- architecture

> Architecture diagram of the GitHub repository trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-
- Repository: https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-

## Overview

This is an airline ticket-booking web application: passengers discover flights and manage accounts, while administrators manage users, roles, and flight inventory. The central booking lifecycle is exposed through the API and spans flight search, seat-holding bookings, payment processing, and ticket/email handling; the frontend tree chiefly documents authentication, flight discovery, profiles, and administration. The README only documents a Docker demo and CI/CD, not additional runtime product features. Several subsystems are represented from the tree or SOURCE INDEX without source excerpts, so those links are omitted where their call relationships cannot be verified.

Main entry points: [`frontend/src/app/AppRouter.jsx`](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/app/AppRouter.jsx) (App routes), [`services/booking.service.js`](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/booking.service.js) (Booking and holds), [`models/index.js`](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/models/index.js) (Sequelize models), [`routes/index.js`](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/index.js) (API route mounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_app_router["App routes<br/>[AppRouter.jsx]"]
  node_auth_provider["Session provider<br/>[AuthProvider.jsx]"]
  node_auth_pages["Sign-in and signup<br/>[LoginPage.jsx]"]
  node_flight_pages["Flight discovery<br/>[HomePage.jsx]"]
  node_flight_api["Flight API client"]
  node_profile_pages["Profile and security"]
  node_admin_pages["User and role admin"]
  node_api_client["HTTP client<br/>[apiClient.js]"]
  node_frontend_auth_api["Frontend auth API<br/>[authApi.js]"]
end

subgraph group_api["API and access"]
  node_express_app["API application<br/>[app.js]"]
  node_route_mounts["API route mounts<br/>[index.js]"]
  node_auth_routes["Authentication routes<br/>[auth.route.js]"]
  node_auth_controller["Authentication controller<br/>[auth.controller.js]"]
  node_auth_service["Identity and sessions<br/>[auth.service.js]"]
end

subgraph group_booking["Booking lifecycle"]
  node_booking_routes["Booking routes<br/>[booking.route.js]"]
  node_booking_controller["Booking controller"]
  node_booking_service["Booking and holds<br/>[booking.service.js]"]
  node_payment_controller["Payment controller"]
  node_payment_service["Payment processing<br/>[payment.service.js]"]
  node_ticket_service["Ticket delivery<br/>[ticket.service.js]"]
  node_email_service["Email service<br/>[email.service.js]"]
  node_expire_job["Booking expiry job"]
end

subgraph group_catalog["Flight catalog"]
  node_flight_service["Flight inventory and search<br/>[flight.service.js]"]
  node_catalog_routes["Catalog routes<br/>[flight.route.js]"]
  node_catalog_controllers["Catalog controllers"]
end

subgraph group_data["Data and events"]
  node_models[("Sequelize models<br/>[index.js]")]
  node_socket_hub["Live flight events<br/>[index.js]"]
end

node_passenger(("Passenger"))
node_admin(("Administrator"))
node_browser(("Browser client"))
node_payment_provider["Payment provider"]
node_database[("Relational database")]
node_mail_service["Email delivery"]

node_passenger -->|"uses"| node_browser
node_admin -->|"uses"| node_browser
node_browser -->|"opens"| node_app_router
node_app_router -->|"routes to"| node_auth_pages
node_app_router -->|"routes to"| node_flight_pages
node_app_router -->|"routes to"| node_profile_pages
node_app_router -->|"routes to"| node_admin_pages
node_auth_pages -->|"uses session"| node_auth_provider
node_flight_pages -->|"requests discovery"| node_flight_api
node_flight_pages -.->|"uses"| node_api_client
node_auth_provider -->|"creates"| node_api_client
node_auth_provider -->|"calls"| node_frontend_auth_api
node_frontend_auth_api -.->|"sends requests"| node_auth_routes
node_api_client -.->|"sends requests"| node_express_app
node_express_app -->|"mounts"| node_route_mounts
node_route_mounts -->|"registers"| node_auth_routes
node_auth_routes -->|"routes to"| node_auth_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"reads and writes"| node_models
node_route_mounts -->|"registers"| node_booking_routes
node_booking_routes -.->|"routes to"| node_booking_controller
node_booking_controller -->|"calls"| node_booking_service
node_booking_service -->|"reads and writes"| node_models
node_booking_service -->|"checks seat warnings"| node_flight_service
node_booking_service -->|"emits seat updates"| node_socket_hub
node_payment_controller -->|"calls"| node_payment_service
node_payment_service -->|"reads and writes"| node_models
node_payment_service -.->|"creates and verifies payments"| node_payment_provider
node_payment_service -->|"requests confirmation"| node_email_service
node_email_service -->|"uses"| node_ticket_service
node_email_service -.->|"sends email"| node_mail_service
node_route_mounts -->|"registers"| node_catalog_routes
node_catalog_routes -.->|"routes to"| node_catalog_controllers
node_catalog_controllers -->|"calls"| node_flight_service
node_flight_service -->|"reads and writes"| node_models
node_flight_service -->|"broadcasts updates"| node_socket_hub
node_expire_job -->|"expires holds"| node_booking_service
node_models -.->|"persists records"| node_database
node_socket_hub -.->|"streams events"| node_browser

click node_app_router "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/app/AppRouter.jsx"
click node_auth_provider "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/app/AuthProvider.jsx"
click node_auth_pages "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/auth/LoginPage.jsx"
click node_flight_pages "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/flights/HomePage.jsx"
click node_flight_api "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/flights/flightDiscoveryApi.js"
click node_profile_pages "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/tree/main/frontend/src/features/profile"
click node_admin_pages "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/tree/main/frontend/src/features/users"
click node_api_client "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/lib/apiClient.js"
click node_frontend_auth_api "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/auth/authApi.js"
click node_express_app "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/app.js"
click node_route_mounts "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/index.js"
click node_auth_routes "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/auth.route.js"
click node_auth_controller "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/auth.controller.js"
click node_auth_service "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/auth.service.js"
click node_booking_routes "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/booking.route.js"
click node_booking_controller "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/booking.controller.js"
click node_booking_service "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/booking.service.js"
click node_payment_controller "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/payment.controller.js"
click node_payment_service "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/payment.service.js"
click node_ticket_service "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/ticket.service.js"
click node_email_service "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/email.service.js"
click node_flight_service "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/flight.service.js"
click node_catalog_routes "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/flight.route.js"
click node_catalog_controllers "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/flight.controller.js"
click node_expire_job "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/jobs/expireBookings.job.js"
click node_models "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/models/index.js"
click node_socket_hub "https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/sockets/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_router,node_auth_provider,node_auth_pages,node_flight_pages,node_flight_api,node_profile_pages,node_admin_pages,node_api_client,node_frontend_auth_api,node_browser toneBlue
class node_express_app,node_route_mounts,node_auth_routes,node_auth_controller,node_auth_service,node_database toneAmber
class node_booking_routes,node_booking_controller,node_booking_service,node_payment_controller,node_payment_service,node_ticket_service,node_email_service,node_expire_job toneMint
class node_flight_service,node_catalog_routes,node_catalog_controllers toneRose
class node_models,node_socket_hub,node_passenger,node_admin,node_payment_provider,node_mail_service toneIndigo
```

## Components

### Web client

- [App routes](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/app/AppRouter.jsx): `frontend/src/app/AppRouter.jsx`
- [Session provider](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/app/AuthProvider.jsx): `frontend/src/app/AuthProvider.jsx`
- [Sign-in and signup](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/auth/LoginPage.jsx): `frontend/src/features/auth/LoginPage.jsx`
- [Flight discovery](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/flights/HomePage.jsx): `frontend/src/features/flights/HomePage.jsx`
- [Flight API client](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/flights/flightDiscoveryApi.js): `frontend/src/features/flights/flightDiscoveryApi.js`
- [Profile and security](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/tree/main/frontend/src/features/profile): `frontend/src/features/profile`
- [User and role admin](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/tree/main/frontend/src/features/users): `frontend/src/features/users`
- [HTTP client](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/lib/apiClient.js): `frontend/src/lib/apiClient.js`
- [Frontend auth API](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/frontend/src/features/auth/authApi.js): `frontend/src/features/auth/authApi.js`

### API and access

- [API application](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/app.js): `app.js`
- [API route mounts](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/index.js): `routes/index.js`
- [Authentication routes](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/auth.route.js): `routes/auth.route.js`
- [Authentication controller](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/auth.controller.js): `controllers/auth.controller.js`
- [Identity and sessions](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/auth.service.js): `services/auth.service.js`

### Booking lifecycle

- [Booking routes](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/booking.route.js): `routes/booking.route.js`
- [Booking controller](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/booking.controller.js): `controllers/booking.controller.js`
- [Booking and holds](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/booking.service.js): `services/booking.service.js`
- [Payment controller](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/payment.controller.js): `controllers/payment.controller.js`
- [Payment processing](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/payment.service.js): `services/payment.service.js`
- [Ticket delivery](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/ticket.service.js): `services/ticket.service.js`
- [Email service](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/email.service.js): `services/email.service.js`
- [Booking expiry job](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/jobs/expireBookings.job.js): `jobs/expireBookings.job.js`

### Flight catalog

- [Flight inventory and search](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/services/flight.service.js): `services/flight.service.js`
- [Catalog routes](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/routes/flight.route.js): `routes/flight.route.js`
- [Catalog controllers](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/controllers/flight.controller.js): `controllers/flight.controller.js`

### Data and events

- [Sequelize models](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/models/index.js): `models/index.js`
- [Live flight events](https://github.com/trancaotrong456/web-specialization-web-project-for-airline-ticket-booking-service-/blob/main/sockets/index.js): `sockets/index.js`

### Other components

- **Passenger**
- **Administrator**
- **Browser client**
- **Payment provider**
- **Relational database**
- **Email delivery**

## Connections

- Passenger → Browser client: uses
- Administrator → Browser client: uses
- Browser client → App routes: opens (evidence: `frontend/src/app/AppRouter.jsx`)
- App routes → Sign-in and signup: routes to (evidence: `frontend/src/app/AppRouter.jsx`)
- App routes → Flight discovery: routes to (evidence: `frontend/src/app/AppRouter.jsx`)
- App routes → Profile and security: routes to (evidence: `frontend/src/app/AppRouter.jsx`)
- App routes → User and role admin: routes to (evidence: `frontend/src/app/AppRouter.jsx`)
- Sign-in and signup → Session provider: uses session (evidence: `frontend/src/features/auth/LoginPage.jsx`)
- Flight discovery → Flight API client: requests discovery (evidence: `frontend/src/features/flights/HomePage.jsx`)
- Flight discovery → HTTP client: uses
- Session provider → HTTP client: creates (evidence: `frontend/src/app/AuthProvider.jsx`)
- Session provider → Frontend auth API: calls (evidence: `frontend/src/app/AuthProvider.jsx`)
- Frontend auth API → Authentication routes: sends requests
- HTTP client → API application: sends requests
- API application → API route mounts: mounts (evidence: `app.js`)
- API route mounts → Authentication routes: registers (evidence: `routes/index.js`)
- Authentication routes → Authentication controller: routes to (evidence: `routes/auth.route.js`)
- Authentication controller → Identity and sessions: calls (evidence: `controllers/auth.controller.js`)
- Identity and sessions → Sequelize models: reads and writes (evidence: `services/auth.service.js`)
- API route mounts → Booking routes: registers (evidence: `routes/index.js`)
- Booking routes → Booking controller: routes to
- Booking controller → Booking and holds: calls (evidence: `controllers/booking.controller.js`)
- Booking and holds → Sequelize models: reads and writes (evidence: `services/booking.service.js`)
- Booking and holds → Flight inventory and search: checks seat warnings (evidence: `services/booking.service.js`)
- Booking and holds → Live flight events: emits seat updates (evidence: `services/booking.service.js`)
- Payment controller → Payment processing: calls (evidence: `controllers/payment.controller.js`)
- Payment processing → Sequelize models: reads and writes (evidence: `services/payment.service.js`)
- Payment processing → Payment provider: creates and verifies payments
- Payment processing → Email service: requests confirmation (evidence: `services/payment.service.js`)
- Email service → Ticket delivery: uses (evidence: `services/email.service.js`)
- Email service → Email delivery: sends email
- API route mounts → Catalog routes: registers (evidence: `routes/index.js`)
- Catalog routes → Catalog controllers: routes to
- Catalog controllers → Flight inventory and search: calls (evidence: `controllers/flight.controller.js`)
- Flight inventory and search → Sequelize models: reads and writes (evidence: `services/flight.service.js`)
- Flight inventory and search → Live flight events: broadcasts updates (evidence: `services/flight.service.js`)
- Booking expiry job → Booking and holds: expires holds (evidence: `jobs/expireBookings.job.js`)
- Sequelize models → Relational database: persists records
- Live flight events → Browser client: streams events
