# district47/skywatch architecture

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

- Interactive diagram: https://gitdiagram.com/district47/skywatch
- Repository: https://github.com/district47/skywatch

## Overview

SkyWatch is a FastAPI/Leaflet monitoring application whose main dashboard workflow starts an aircraft or drone receiver, merges observations into a shared target tracker, and exposes the resulting map data and status through the web API. The repository also retains backend-only AIS, APRS, and NOAA capabilities. The graph preserves those documented branches; some internal details are represented at their source-file level because their implementations were not excerpted.

Main entry points: [`skywatch/web/manager.py`](https://github.com/District47/SkyWatch/blob/main/skywatch/web/manager.py) (Module lifecycle manager), [`skywatch/web/server.py`](https://github.com/District47/SkyWatch/blob/main/skywatch/web/server.py) (REST and WebSocket API), [`skywatch/tracker.py`](https://github.com/District47/SkyWatch/blob/main/skywatch/tracker.py) (Unified target tracker), [`skywatch/adsb/sbs.py`](https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/sbs.py) (SBS and OpenSky feeds)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Dashboard and control"]
  node_frontend["Map interface<br/>[app.js]"]
  node_api["REST and WebSocket API<br/>[server.py]"]
  node_manager["Module lifecycle manager<br/>[manager.py]"]
  node_alerts["Alert zones<br/>[alerts.py]"]
end

subgraph group_air["Aircraft monitoring"]
  node_air_native["Native ADS-B receiver<br/>[native.py]"]
  node_air_external["SBS and OpenSky feeds<br/>[sbs.py]"]
  node_air_db[("Aircraft metadata<br/>[aircraft_db.py]")]
  node_air_classify["Aircraft classification<br/>[classify.py]"]
end

subgraph group_drone["Drone Remote ID"]
  node_drone_ble["Onboard BLE scanner<br/>[ble.py]"]
  node_drone_hci["Realtek raw-HCI scanner<br/>[ble_hci.py]"]
  node_drone_wifi["WiFi Remote ID parser<br/>[remoteid.py]"]
end

subgraph group_marine["AIS and APRS"]
  node_ais_rf["AIS radio receiver<br/>[nmea.py]"]
  node_ais_online["AISStream feed<br/>[aisstream.py]"]
  node_ais_lookup["Vessel reference lookups<br/>[lookups.py]"]
  node_aprs_is["APRS-IS gateway<br/>[is_client.py]"]
  node_aprs_rf["APRS radio receiver<br/>[rf.py]"]
  node_aprs_parser["APRS packet parser<br/>[parser.py]"]
  node_aprs_store[("APRS station store<br/>[store.py]")]
  node_aprs_tx["APRS transmit<br/>[tx.py]"]
end

subgraph group_weather["NOAA and shared state"]
  node_tracker[("Unified target tracker<br/>[tracker.py]")]
  node_noaa_tracking["Satellite pass tracking<br/>[tracking.py]"]
  node_noaa_apt["APT image capture<br/>[apt.py]"]
  node_noaa_radio["Weather radio<br/>[weather_radio.py]"]
  node_noaa_weather["Weather.gov API<br/>[weather_api.py]"]
end

node_user(("Dashboard user"))
node_external{{"External data services"}}

node_user -->|"operates"| node_frontend
node_frontend -->|"requests data"| node_api
node_api -->|"dispatches modules"| node_manager
node_api -->|"reads targets"| node_tracker
node_manager -->|"starts receiver"| node_air_native
node_manager -->|"starts feeds"| node_air_external
node_manager -->|"loads metadata"| node_air_db
node_manager -->|"starts scanner"| node_drone_ble
node_manager -.->|"starts scanner"| node_drone_hci
node_manager -.->|"starts scanner"| node_drone_wifi
node_manager -->|"starts receiver"| node_ais_rf
node_manager -->|"starts feed"| node_ais_online
node_manager -->|"starts gateway"| node_aprs_is
node_manager -->|"starts receiver"| node_aprs_rf
node_air_native -->|"looks up aircraft"| node_air_db
node_air_native -->|"classifies aircraft"| node_air_classify
node_air_native -->|"upserts targets"| node_tracker
node_air_external -->|"uses metadata"| node_air_db
node_air_external -->|"classifies aircraft"| node_air_classify
node_air_external -->|"upserts targets"| node_tracker
node_drone_ble -->|"uses RID decoder"| node_drone_wifi
node_drone_ble -->|"upserts targets"| node_tracker
node_drone_hci -->|"upserts targets"| node_tracker
node_drone_wifi -->|"upserts targets"| node_tracker
node_ais_rf -->|"uses reference data"| node_ais_lookup
node_ais_rf -->|"upserts targets"| node_tracker
node_ais_online -->|"uses reference data"| node_ais_lookup
node_ais_online -->|"upserts targets"| node_tracker
node_aprs_is -->|"parses packets"| node_aprs_parser
node_aprs_is -->|"stores messages"| node_aprs_store
node_aprs_rf -->|"parses packets"| node_aprs_parser
node_aprs_rf -->|"stores stations"| node_aprs_store
node_api -->|"routes transmissions"| node_aprs_tx
node_api -->|"serves alert events"| node_alerts
node_tracker -->|"notifies observers"| node_alerts
node_api -->|"serves tracking"| node_noaa_tracking
node_api -->|"dispatches capture"| node_noaa_apt
node_api -->|"serves radio"| node_noaa_radio
node_api -->|"requests forecasts"| node_noaa_weather
node_air_external -->|"queries OpenSky"| node_external
node_ais_online -->|"connects AISStream"| node_external
node_noaa_weather -->|"queries weather.gov"| node_external

click node_frontend "https://github.com/District47/SkyWatch/blob/main/skywatch/web/static/js/app.js"
click node_api "https://github.com/District47/SkyWatch/blob/main/skywatch/web/server.py"
click node_manager "https://github.com/District47/SkyWatch/blob/main/skywatch/web/manager.py"
click node_tracker "https://github.com/District47/SkyWatch/blob/main/skywatch/tracker.py"
click node_alerts "https://github.com/District47/SkyWatch/blob/main/skywatch/alerts.py"
click node_air_native "https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/native.py"
click node_air_external "https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/sbs.py"
click node_air_db "https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/aircraft_db.py"
click node_air_classify "https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/classify.py"
click node_drone_ble "https://github.com/District47/SkyWatch/blob/main/skywatch/remoteid/ble.py"
click node_drone_hci "https://github.com/District47/SkyWatch/blob/main/skywatch/remoteid/ble_hci.py"
click node_drone_wifi "https://github.com/District47/SkyWatch/blob/main/skywatch/remoteid/remoteid.py"
click node_ais_rf "https://github.com/District47/SkyWatch/blob/main/skywatch/ais/nmea.py"
click node_ais_online "https://github.com/District47/SkyWatch/blob/main/skywatch/ais/aisstream.py"
click node_ais_lookup "https://github.com/District47/SkyWatch/blob/main/skywatch/ais/lookups.py"
click node_aprs_is "https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/is_client.py"
click node_aprs_rf "https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/rf.py"
click node_aprs_parser "https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/parser.py"
click node_aprs_store "https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/store.py"
click node_aprs_tx "https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/tx.py"
click node_noaa_tracking "https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/tracking.py"
click node_noaa_apt "https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/apt.py"
click node_noaa_radio "https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/weather_radio.py"
click node_noaa_weather "https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/weather_api.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_frontend,node_api,node_manager,node_alerts,node_user toneBlue
class node_air_native,node_air_external,node_air_db,node_air_classify toneAmber
class node_drone_ble,node_drone_hci,node_drone_wifi toneMint
class node_ais_rf,node_ais_online,node_ais_lookup,node_aprs_is,node_aprs_rf,node_aprs_parser,node_aprs_store,node_aprs_tx toneRose
class node_tracker,node_noaa_tracking,node_noaa_apt,node_noaa_radio,node_noaa_weather,node_external toneIndigo
```

## Components

### Dashboard and control

- [Map interface](https://github.com/District47/SkyWatch/blob/main/skywatch/web/static/js/app.js): `skywatch/web/static/js/app.js`
- [REST and WebSocket API](https://github.com/District47/SkyWatch/blob/main/skywatch/web/server.py): `skywatch/web/server.py`
- [Module lifecycle manager](https://github.com/District47/SkyWatch/blob/main/skywatch/web/manager.py): `skywatch/web/manager.py`
- [Alert zones](https://github.com/District47/SkyWatch/blob/main/skywatch/alerts.py): `skywatch/alerts.py`

### Aircraft monitoring

- [Native ADS-B receiver](https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/native.py): `skywatch/adsb/native.py`
- [SBS and OpenSky feeds](https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/sbs.py): `skywatch/adsb/sbs.py`
- [Aircraft metadata](https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/aircraft_db.py): `skywatch/adsb/aircraft_db.py`
- [Aircraft classification](https://github.com/District47/SkyWatch/blob/main/skywatch/adsb/classify.py): `skywatch/adsb/classify.py`

### Drone Remote ID

- [Onboard BLE scanner](https://github.com/District47/SkyWatch/blob/main/skywatch/remoteid/ble.py): `skywatch/remoteid/ble.py`
- [Realtek raw-HCI scanner](https://github.com/District47/SkyWatch/blob/main/skywatch/remoteid/ble_hci.py): `skywatch/remoteid/ble_hci.py`
- [WiFi Remote ID parser](https://github.com/District47/SkyWatch/blob/main/skywatch/remoteid/remoteid.py): `skywatch/remoteid/remoteid.py`

### AIS and APRS

- [AIS radio receiver](https://github.com/District47/SkyWatch/blob/main/skywatch/ais/nmea.py): `skywatch/ais/nmea.py`
- [AISStream feed](https://github.com/District47/SkyWatch/blob/main/skywatch/ais/aisstream.py): `skywatch/ais/aisstream.py`
- [Vessel reference lookups](https://github.com/District47/SkyWatch/blob/main/skywatch/ais/lookups.py): `skywatch/ais/lookups.py`
- [APRS-IS gateway](https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/is_client.py): `skywatch/aprs/is_client.py`
- [APRS radio receiver](https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/rf.py): `skywatch/aprs/rf.py`
- [APRS packet parser](https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/parser.py): `skywatch/aprs/parser.py`
- [APRS station store](https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/store.py): `skywatch/aprs/store.py`
- [APRS transmit](https://github.com/District47/SkyWatch/blob/main/skywatch/aprs/tx.py): `skywatch/aprs/tx.py`

### NOAA and shared state

- [Unified target tracker](https://github.com/District47/SkyWatch/blob/main/skywatch/tracker.py): `skywatch/tracker.py`
- [Satellite pass tracking](https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/tracking.py): `skywatch/noaa/tracking.py`
- [APT image capture](https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/apt.py): `skywatch/noaa/apt.py`
- [Weather radio](https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/weather_radio.py): `skywatch/noaa/weather_radio.py`
- [Weather.gov API](https://github.com/District47/SkyWatch/blob/main/skywatch/noaa/weather_api.py): `skywatch/noaa/weather_api.py`

### Other components

- **Dashboard user**
- **External data services**

## Connections

- Dashboard user → Map interface: operates
- Map interface → REST and WebSocket API: requests data
- REST and WebSocket API → Module lifecycle manager: dispatches modules (evidence: `skywatch/web/server.py`)
- REST and WebSocket API → Unified target tracker: reads targets (evidence: `skywatch/web/server.py`)
- Module lifecycle manager → Native ADS-B receiver: starts receiver (evidence: `skywatch/web/manager.py`)
- Module lifecycle manager → SBS and OpenSky feeds: starts feeds (evidence: `skywatch/web/manager.py`)
- Module lifecycle manager → Aircraft metadata: loads metadata (evidence: `skywatch/web/manager.py`)
- Module lifecycle manager → Onboard BLE scanner: starts scanner (evidence: `skywatch/web/manager.py`)
- Module lifecycle manager → Realtek raw-HCI scanner: starts scanner
- Module lifecycle manager → WiFi Remote ID parser: starts scanner
- Module lifecycle manager → AIS radio receiver: starts receiver (evidence: `skywatch/web/manager.py`)
- Module lifecycle manager → AISStream feed: starts feed (evidence: `skywatch/web/manager.py`)
- Module lifecycle manager → APRS-IS gateway: starts gateway (evidence: `skywatch/web/manager.py`)
- Module lifecycle manager → APRS radio receiver: starts receiver (evidence: `skywatch/web/manager.py`)
- Native ADS-B receiver → Aircraft metadata: looks up aircraft (evidence: `skywatch/adsb/native.py`)
- Native ADS-B receiver → Aircraft classification: classifies aircraft (evidence: `skywatch/adsb/native.py`)
- Native ADS-B receiver → Unified target tracker: upserts targets (evidence: `skywatch/adsb/native.py`)
- SBS and OpenSky feeds → Aircraft metadata: uses metadata (evidence: `skywatch/adsb/sbs.py`)
- SBS and OpenSky feeds → Aircraft classification: classifies aircraft (evidence: `skywatch/adsb/sbs.py`)
- SBS and OpenSky feeds → Unified target tracker: upserts targets (evidence: `skywatch/adsb/sbs.py`)
- Onboard BLE scanner → WiFi Remote ID parser: uses RID decoder (evidence: `skywatch/remoteid/ble.py`)
- Onboard BLE scanner → Unified target tracker: upserts targets (evidence: `skywatch/remoteid/ble.py`)
- Realtek raw-HCI scanner → Unified target tracker: upserts targets (evidence: `skywatch/remoteid/ble_hci.py`)
- WiFi Remote ID parser → Unified target tracker: upserts targets (evidence: `skywatch/remoteid/remoteid.py`)
- AIS radio receiver → Vessel reference lookups: uses reference data (evidence: `skywatch/ais/nmea.py`)
- AIS radio receiver → Unified target tracker: upserts targets (evidence: `skywatch/ais/nmea.py`)
- AISStream feed → Vessel reference lookups: uses reference data (evidence: `skywatch/ais/aisstream.py`)
- AISStream feed → Unified target tracker: upserts targets (evidence: `skywatch/ais/aisstream.py`)
- APRS-IS gateway → APRS packet parser: parses packets (evidence: `skywatch/aprs/is_client.py`)
- APRS-IS gateway → APRS station store: stores messages (evidence: `skywatch/aprs/is_client.py`)
- APRS radio receiver → APRS packet parser: parses packets (evidence: `skywatch/aprs/rf.py`)
- APRS radio receiver → APRS station store: stores stations (evidence: `skywatch/aprs/rf.py`)
- REST and WebSocket API → APRS transmit: routes transmissions (evidence: `skywatch/web/server.py`)
- REST and WebSocket API → Alert zones: serves alert events (evidence: `skywatch/web/server.py`)
- Unified target tracker → Alert zones: notifies observers (evidence: `skywatch/tracker.py`)
- REST and WebSocket API → Satellite pass tracking: serves tracking (evidence: `skywatch/web/server.py`)
- REST and WebSocket API → APT image capture: dispatches capture (evidence: `skywatch/web/server.py`)
- REST and WebSocket API → Weather radio: serves radio (evidence: `skywatch/web/server.py`)
- REST and WebSocket API → Weather.gov API: requests forecasts (evidence: `skywatch/web/server.py`)
- SBS and OpenSky feeds → External data services: queries OpenSky
- AISStream feed → External data services: connects AISStream
- Weather.gov API → External data services: queries weather.gov
