# hoangkhuong55551/buyflightstickets architecture

> Architecture diagram of the GitHub repository hoangkhuong55551/buyflightstickets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hoangkhuong55551/buyflightstickets
- Repository: https://github.com/hoangkhuong55551/buyflightstickets

## Overview

SkyBook is a Django flight-booking application. Customers enter through the site, find flights, select a seat, provide passenger details, pay, and manage their bookings; the README also documents account management, recommendations, and refund requests. The graph preserves those product branches and the booking, ticket, flight, payment, and user data layers. View implementations and root routing were not sampled, so some connections reflect README-documented capabilities and the configured app structure; uncertain internal handoffs are omitted.

Main entry points: [`config/urls.py`](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/config/urls.py) (Django routing), [`bookings/views.py`](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/views.py) (Booking and seats), [`flights/models.py`](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/flights/models.py) (Flight catalog), [`recommendations/views.py`](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/recommendations/views.py) (Featured destinations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_routing["Django routing<br/>[urls.py]"]
end

subgraph group_discovery["Flight discovery"]
  node_flight_views["Flight search<br/>[views.py]"]
  node_flight_catalog[("Flight catalog<br/>[models.py]")]
  node_recommendation_views["Featured destinations<br/>[views.py]"]
  node_recommendation_service["Recommendation scoring<br/>[services.py]"]
  node_recommendation_data[("Recommendation data<br/>[models.py]")]
end

subgraph group_booking["Booking lifecycle"]
  node_booking_views["Booking and seats<br/>[views.py]"]
  node_booking_forms["Passenger details<br/>[forms.py]"]
  node_booking_data[("Bookings and tickets<br/>[models.py]")]
  node_expiry_command["Expired booking cleanup"]
  node_seat_ui["Seat selection UI<br/>[seat.js]"]
end

subgraph group_accounts["Accounts and recommendations"]
  node_user_views["Account access<br/>[views.py]"]
  node_user_data[("User profiles<br/>[models.py]")]
end

subgraph group_operations["Payments and data"]
  node_payment_views["Payment and refunds<br/>[views.py]"]
  node_payment_data[("Payment records<br/>[models.py]")]
  node_postgres[("PostgreSQL")]
  node_email["Email service"]
end

node_customer(("Customer"))
node_administrator(("Administrator"))

node_customer -->|"requests pages"| node_routing
node_administrator -->|"requests admin"| node_routing
node_routing -->|"routes flight requests"| node_flight_views
node_routing -->|"routes destination requests"| node_recommendation_views
node_routing -->|"routes booking requests"| node_booking_views
node_routing -->|"routes account requests"| node_user_views
node_routing -->|"routes payment requests"| node_payment_views
node_flight_views -->|"queries flights"| node_flight_catalog
node_recommendation_views -->|"loads destinations"| node_recommendation_data
node_recommendation_views -->|"scores options"| node_recommendation_service
node_booking_views -->|"loads flight"| node_flight_catalog
node_booking_views -->|"creates and reads bookings"| node_booking_data
node_booking_views -->|"validates passenger details"| node_booking_forms
node_booking_views -->|"redirects to payment"| node_payment_views
node_seat_ui -->|"shows seat selection"| node_customer
node_customer -->|"selects seat"| node_seat_ui
node_user_views -->|"manages accounts"| node_user_data
node_payment_views -->|"records transactions"| node_payment_data
node_expiry_command -->|"cancels expired bookings"| node_booking_data
node_expiry_command -->|"releases seats"| node_flight_catalog
node_flight_catalog -->|"persists flight data"| node_postgres
node_booking_data -->|"persists booking data"| node_postgres
node_recommendation_data -->|"persists destination data"| node_postgres
node_user_data -->|"persists user data"| node_postgres
node_payment_data -->|"persists payment data"| node_postgres

click node_routing "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/config/urls.py"
click node_flight_views "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/flights/views.py"
click node_flight_catalog "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/flights/models.py"
click node_recommendation_views "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/recommendations/views.py"
click node_recommendation_service "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/recommendations/services.py"
click node_recommendation_data "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/recommendations/models.py"
click node_booking_views "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/views.py"
click node_booking_forms "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/forms.py"
click node_booking_data "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/models.py"
click node_expiry_command "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/management/commands/cancel_expired_bookings.py"
click node_seat_ui "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/static/js/seat.js"
click node_user_views "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/users/views.py"
click node_user_data "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/users/models.py"
click node_payment_views "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/payments/views.py"
click node_payment_data "https://github.com/hoangkhuong55551/buyflightstickets/blob/main/payments/models.py"

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_routing toneBlue
class node_flight_views,node_flight_catalog,node_recommendation_views,node_recommendation_service,node_recommendation_data toneAmber
class node_booking_views,node_booking_forms,node_booking_data,node_expiry_command,node_seat_ui toneMint
class node_user_views,node_user_data toneRose
class node_payment_views,node_payment_data,node_postgres,node_email,node_customer,node_administrator toneIndigo
```

## Components

### Web entry

- [Django routing](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/config/urls.py): `config/urls.py`

### Flight discovery

- [Flight search](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/flights/views.py): `flights/views.py`
- [Flight catalog](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/flights/models.py): `flights/models.py`
- [Featured destinations](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/recommendations/views.py): `recommendations/views.py`
- [Recommendation scoring](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/recommendations/services.py): `recommendations/services.py`
- [Recommendation data](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/recommendations/models.py): `recommendations/models.py`

### Booking lifecycle

- [Booking and seats](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/views.py): `bookings/views.py`
- [Passenger details](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/forms.py): `bookings/forms.py`
- [Bookings and tickets](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/models.py): `bookings/models.py`
- [Expired booking cleanup](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/bookings/management/commands/cancel_expired_bookings.py): `bookings/management/commands/cancel_expired_bookings.py`
- [Seat selection UI](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/static/js/seat.js): `static/js/seat.js`

### Accounts and recommendations

- [Account access](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/users/views.py): `users/views.py`
- [User profiles](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/users/models.py): `users/models.py`

### Payments and data

- [Payment and refunds](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/payments/views.py): `payments/views.py`
- [Payment records](https://github.com/hoangkhuong55551/buyflightstickets/blob/main/payments/models.py): `payments/models.py`
- **PostgreSQL**
- **Email service**

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → Django routing: requests pages
- Administrator → Django routing: requests admin
- Django routing → Flight search: routes flight requests
- Django routing → Featured destinations: routes destination requests
- Django routing → Booking and seats: routes booking requests
- Django routing → Account access: routes account requests
- Django routing → Payment and refunds: routes payment requests
- Flight search → Flight catalog: queries flights
- Featured destinations → Recommendation data: loads destinations
- Featured destinations → Recommendation scoring: scores options
- Booking and seats → Flight catalog: loads flight
- Booking and seats → Bookings and tickets: creates and reads bookings
- Booking and seats → Passenger details: validates passenger details
- Booking and seats → Payment and refunds: redirects to payment
- Seat selection UI → Customer: shows seat selection
- Customer → Seat selection UI: selects seat
- Account access → User profiles: manages accounts
- Payment and refunds → Payment records: records transactions
- Expired booking cleanup → Bookings and tickets: cancels expired bookings
- Expired booking cleanup → Flight catalog: releases seats
- Flight catalog → PostgreSQL: persists flight data
- Bookings and tickets → PostgreSQL: persists booking data
- Recommendation data → PostgreSQL: persists destination data
- User profiles → PostgreSQL: persists user data
- Payment records → PostgreSQL: persists payment data
