# shaun-ho/flights architecture

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

- Interactive diagram: https://gitdiagram.com/shaun-ho/flights
- Repository: https://github.com/shaun-ho/flights

## Overview

flights is a real-time Open Glider Network aircraft tracker: it ingests APRS data, parses aircraft reports, maintains buffered tracks, and displays them on a map. The configured pipeline is assembled in `src/pipeline/setup.rs`; its tasks run under the shared thread manager. The GUI reads the airspace viewer, while disk logging is an optional pipeline capability. Edges reflect the setup and sampled calls; where stage ordering is documented but the connecting code was not shown, the README is cited.

Main entry points: [`crates/ingestor/src/task.rs`](https://github.com/shaun-ho/flights/blob/main/crates/ingestor/src/task.rs) (APRS Ingestor), [`src/pipeline/setup.rs`](https://github.com/shaun-ho/flights/blob/main/src/pipeline/setup.rs) (Pipeline Setup), [`crates/parser/src/conversion.rs`](https://github.com/shaun-ho/flights/blob/main/crates/parser/src/conversion.rs) (Aircraft Parser), [`crates/airspace/src/task.rs`](https://github.com/shaun-ho/flights/blob/main/crates/airspace/src/task.rs) (Airspace Store Task)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application Entry"]
  node_app["CLI and App<br/>[main.rs]"]
end

subgraph group_pipeline["Data Pipeline"]
  node_config["Pipeline Config<br/>[config.rs]"]
  node_setup["Pipeline Setup<br/>[setup.rs]"]
  node_ingestor["APRS Ingestor<br/>[task.rs]"]
  node_parser["Aircraft Parser<br/>[conversion.rs]"]
  node_aircraft["Aircraft Model<br/>[conversion.rs]"]
end

subgraph group_state["Airspace State"]
  node_airspace_store["Airspace Store Task<br/>[task.rs]"]
  node_airspace[("Tracks and History<br/>[detail.rs]")]
  node_viewer["Airspace Viewer<br/>[task.rs]"]
end

subgraph group_runtime["Runtime Services"]
  node_thread_manager["Thread Manager<br/>[thread_manager.rs]"]
  node_logging["Disk Logging<br/>[logger_registry.rs]"]
  node_proto["Protobuf Types<br/>[lib.rs]"]
end

subgraph group_presentation["Map Presentation"]
  node_gui["Radar Map UI<br/>[app.rs]"]
  node_tiles["OpenStreetMap Tiles"]
end

node_user(("Operator"))
node_ogn["OGN APRS Service"]

node_user -->|"runs"| node_app
node_app -->|"loads settings"| node_config
node_setup -->|"uses settings"| node_config
node_setup -->|"constructs"| node_ingestor
node_ogn -.->|"streams APRS"| node_ingestor
node_ingestor -.->|"forwards packets"| node_parser
node_parser -->|"converts reports"| node_aircraft
node_parser -->|"forwards aircraft"| node_airspace_store
node_airspace_store -->|"updates tracks"| node_airspace
node_airspace_store -->|"shares state"| node_viewer
node_setup -->|"registers tasks"| node_thread_manager
node_setup -->|"registers loggers"| node_logging
node_ingestor -->|"sends packets"| node_logging
node_airspace_store -->|"logs updates"| node_logging
node_ingestor -->|"encodes packets"| node_proto
node_parser -->|"converts messages"| node_proto
node_gui -->|"reads tracks"| node_viewer
node_gui -->|"requests map tiles"| node_tiles
node_app -->|"launches optionally"| node_gui

click node_app "https://github.com/shaun-ho/flights/blob/main/src/main.rs"
click node_config "https://github.com/shaun-ho/flights/blob/main/src/pipeline/config.rs"
click node_setup "https://github.com/shaun-ho/flights/blob/main/src/pipeline/setup.rs"
click node_ingestor "https://github.com/shaun-ho/flights/blob/main/crates/ingestor/src/task.rs"
click node_parser "https://github.com/shaun-ho/flights/blob/main/crates/parser/src/conversion.rs"
click node_aircraft "https://github.com/shaun-ho/flights/blob/main/crates/parser/src/conversion.rs"
click node_airspace_store "https://github.com/shaun-ho/flights/blob/main/crates/airspace/src/task.rs"
click node_airspace "https://github.com/shaun-ho/flights/blob/main/crates/airspace/src/detail.rs"
click node_viewer "https://github.com/shaun-ho/flights/blob/main/crates/airspace/src/task.rs"
click node_thread_manager "https://github.com/shaun-ho/flights/blob/main/crates/core/src/thread_manager.rs"
click node_logging "https://github.com/shaun-ho/flights/blob/main/crates/core/src/logging/logger_registry.rs"
click node_proto "https://github.com/shaun-ho/flights/blob/main/crates/proto/src/lib.rs"
click node_gui "https://github.com/shaun-ho/flights/blob/main/src/gui/app.rs"

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 toneBlue
class node_config,node_setup,node_ingestor,node_parser,node_aircraft toneAmber
class node_airspace_store,node_airspace,node_viewer toneMint
class node_thread_manager,node_logging,node_proto toneRose
class node_gui,node_tiles,node_user,node_ogn toneIndigo
```

## Components

### Application Entry

- [CLI and App](https://github.com/shaun-ho/flights/blob/main/src/main.rs): `src/main.rs`

### Data Pipeline

- [Pipeline Config](https://github.com/shaun-ho/flights/blob/main/src/pipeline/config.rs): `src/pipeline/config.rs`
- [Pipeline Setup](https://github.com/shaun-ho/flights/blob/main/src/pipeline/setup.rs): `src/pipeline/setup.rs`
- [APRS Ingestor](https://github.com/shaun-ho/flights/blob/main/crates/ingestor/src/task.rs): `crates/ingestor/src/task.rs`
- [Aircraft Parser](https://github.com/shaun-ho/flights/blob/main/crates/parser/src/conversion.rs): `crates/parser/src/conversion.rs`
- [Aircraft Model](https://github.com/shaun-ho/flights/blob/main/crates/parser/src/conversion.rs): `crates/parser/src/conversion.rs`

### Airspace State

- [Airspace Store Task](https://github.com/shaun-ho/flights/blob/main/crates/airspace/src/task.rs): `crates/airspace/src/task.rs`
- [Tracks and History](https://github.com/shaun-ho/flights/blob/main/crates/airspace/src/detail.rs): `crates/airspace/src/detail.rs`
- [Airspace Viewer](https://github.com/shaun-ho/flights/blob/main/crates/airspace/src/task.rs): `crates/airspace/src/task.rs`

### Runtime Services

- [Thread Manager](https://github.com/shaun-ho/flights/blob/main/crates/core/src/thread_manager.rs): `crates/core/src/thread_manager.rs`
- [Disk Logging](https://github.com/shaun-ho/flights/blob/main/crates/core/src/logging/logger_registry.rs): `crates/core/src/logging/logger_registry.rs`
- [Protobuf Types](https://github.com/shaun-ho/flights/blob/main/crates/proto/src/lib.rs): `crates/proto/src/lib.rs`

### Map Presentation

- [Radar Map UI](https://github.com/shaun-ho/flights/blob/main/src/gui/app.rs): `src/gui/app.rs`
- **OpenStreetMap Tiles**

### Other components

- **Operator**
- **OGN APRS Service**

## Connections

- Operator → CLI and App: runs
- CLI and App → Pipeline Config: loads settings
- Pipeline Setup → Pipeline Config: uses settings (evidence: `src/pipeline/setup.rs`)
- Pipeline Setup → APRS Ingestor: constructs (evidence: `src/pipeline/setup.rs`)
- OGN APRS Service → APRS Ingestor: streams APRS
- APRS Ingestor → Aircraft Parser: forwards packets
- Aircraft Parser → Aircraft Model: converts reports (evidence: `crates/parser/src/conversion.rs`)
- Aircraft Parser → Airspace Store Task: forwards aircraft
- Airspace Store Task → Tracks and History: updates tracks (evidence: `crates/airspace/src/task.rs`)
- Airspace Store Task → Airspace Viewer: shares state (evidence: `crates/airspace/src/task.rs`)
- Pipeline Setup → Thread Manager: registers tasks (evidence: `src/pipeline/setup.rs`)
- Pipeline Setup → Disk Logging: registers loggers (evidence: `src/pipeline/setup.rs`)
- APRS Ingestor → Disk Logging: sends packets (evidence: `crates/ingestor/src/task.rs`)
- Airspace Store Task → Disk Logging: logs updates (evidence: `crates/airspace/src/task.rs`)
- APRS Ingestor → Protobuf Types: encodes packets (evidence: `crates/ingestor/src/task.rs`)
- Aircraft Parser → Protobuf Types: converts messages (evidence: `crates/parser/src/conversion.rs`)
- Radar Map UI → Airspace Viewer: reads tracks (evidence: `src/gui/app.rs`)
- Radar Map UI → OpenStreetMap Tiles: requests map tiles (evidence: `src/gui/app.rs`)
- CLI and App → Radar Map UI: launches optionally
