# mike-muteithia/skylink-airlines_a4 architecture

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

- Interactive diagram: https://gitdiagram.com/mike-muteithia/skylink-airlines_a4
- Repository: https://github.com/mike-muteithia/skylink-airlines_a4

## Overview

SkyLink is a Flask flight-ticketing application. Customers browse or search available flights, reserve seats, then retrieve or cancel bookings; administrators log in to manage flights and inspect bookings and dashboard metrics. A Socket.IO chat widget answers flight-availability and company-information questions. The excerpts show route logic and SQLite queries in app.py, and schema/seed setup in database.py. Template and dashboard details are supported by the README and tree, but their route wiring and unsampled implementations are not independently verified.

Main entry points: [`database.py`](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/database.py) (SQLite schema), [`app.py`](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py) (Flight discovery), [`templates/admin`](https://github.com/mike-muteithia/skylink-airlines_a4/tree/main/templates/admin) (Admin dashboard), [`static/js/script.js`](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/static/js/script.js) (Chat widget)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer booking"]
  node_flights["Flight discovery<br/>[app.py]"]
  node_flight_pages["Flight pages"]
  node_reservation["Reservations<br/>[app.py]"]
  node_booking_pages["Booking pages"]
  node_booking_lookup["Booking retrieval<br/>[app.py]"]
end

subgraph group_operations["Airline administration"]
  node_admin_auth["Admin login<br/>[app.py]"]
  node_flight_admin["Flight management<br/>[app.py]"]
  node_booking_admin["Booking management<br/>[app.py]"]
  node_admin_pages["Admin dashboard"]
end

subgraph group_assistant["Chat assistant"]
  node_chat_widget["Chat widget<br/>[script.js]"]
  node_chat_handler["Chat handler<br/>[app.py]"]
end

subgraph group_storage["Persistence"]
  node_sqlite_schema[("SQLite schema<br/>[database.py]")]
end

node_traveler(("Traveler"))

node_traveler -->|"searches"| node_flights
node_flights -->|"queries flights"| node_sqlite_schema
node_flights -.->|"renders results"| node_flight_pages
node_traveler -->|"books flight"| node_reservation
node_reservation -->|"writes bookings"| node_sqlite_schema
node_reservation -.->|"renders confirmation"| node_booking_pages
node_traveler -->|"retrieves or cancels"| node_booking_lookup
node_booking_lookup -->|"queries bookings"| node_sqlite_schema
node_traveler -->|"signs in"| node_admin_auth
node_admin_auth -->|"checks account"| node_sqlite_schema
node_admin_auth -.->|"opens dashboard"| node_admin_pages
node_admin_pages -.->|"manages flights"| node_flight_admin
node_admin_pages -.->|"views bookings"| node_booking_admin
node_flight_admin -->|"writes flights"| node_sqlite_schema
node_booking_admin -->|"queries bookings"| node_sqlite_schema
node_traveler -->|"asks"| node_chat_widget
node_chat_widget -->|"emits message"| node_chat_handler
node_chat_handler -->|"emits response"| node_chat_widget
node_chat_handler -->|"checks availability"| node_sqlite_schema

click node_flights "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py"
click node_flight_pages "https://github.com/mike-muteithia/skylink-airlines_a4/tree/main/templates"
click node_reservation "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py"
click node_booking_pages "https://github.com/mike-muteithia/skylink-airlines_a4/tree/main/templates"
click node_booking_lookup "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py"
click node_admin_auth "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py"
click node_flight_admin "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py"
click node_booking_admin "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py"
click node_admin_pages "https://github.com/mike-muteithia/skylink-airlines_a4/tree/main/templates/admin"
click node_chat_widget "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/static/js/script.js"
click node_chat_handler "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py"
click node_sqlite_schema "https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/database.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_flights,node_flight_pages,node_reservation,node_booking_pages,node_booking_lookup toneBlue
class node_admin_auth,node_flight_admin,node_booking_admin,node_admin_pages toneAmber
class node_chat_widget,node_chat_handler toneMint
class node_sqlite_schema toneRose
class node_traveler toneIndigo
```

## Components

### Customer booking

- [Flight discovery](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py): `app.py`
- [Flight pages](https://github.com/mike-muteithia/skylink-airlines_a4/tree/main/templates): `templates`
- [Reservations](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py): `app.py`
- [Booking pages](https://github.com/mike-muteithia/skylink-airlines_a4/tree/main/templates): `templates`
- [Booking retrieval](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py): `app.py`

### Airline administration

- [Admin login](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py): `app.py`
- [Flight management](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py): `app.py`
- [Booking management](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py): `app.py`
- [Admin dashboard](https://github.com/mike-muteithia/skylink-airlines_a4/tree/main/templates/admin): `templates/admin`

### Chat assistant

- [Chat widget](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/static/js/script.js): `static/js/script.js`
- [Chat handler](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/app.py): `app.py`

### Persistence

- [SQLite schema](https://github.com/mike-muteithia/skylink-airlines_a4/blob/main/database.py): `database.py`

### Other components

- **Traveler**

## Connections

- Traveler → Flight discovery: searches (evidence: `README.md`)
- Flight discovery → SQLite schema: queries flights (evidence: `app.py`)
- Flight discovery → Flight pages: renders results
- Traveler → Reservations: books flight (evidence: `README.md`)
- Reservations → SQLite schema: writes bookings (evidence: `app.py`)
- Reservations → Booking pages: renders confirmation
- Traveler → Booking retrieval: retrieves or cancels (evidence: `README.md`)
- Booking retrieval → SQLite schema: queries bookings (evidence: `app.py`)
- Traveler → Admin login: signs in (evidence: `README.md`)
- Admin login → SQLite schema: checks account (evidence: `app.py`)
- Admin login → Admin dashboard: opens dashboard
- Admin dashboard → Flight management: manages flights (evidence: `README.md`)
- Admin dashboard → Booking management: views bookings (evidence: `README.md`)
- Flight management → SQLite schema: writes flights (evidence: `app.py`)
- Booking management → SQLite schema: queries bookings (evidence: `app.py`)
- Traveler → Chat widget: asks (evidence: `static/js/script.js`)
- Chat widget → Chat handler: emits message (evidence: `static/js/script.js`)
- Chat handler → Chat widget: emits response (evidence: `app.py`)
- Chat handler → SQLite schema: checks availability (evidence: `app.py`)
