# gitfeber/uavgroundcontrolstation architecture

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

- Interactive diagram: https://gitdiagram.com/gitfeber/uavgroundcontrolstation
- Repository: https://github.com/gitfeber/uavgroundcontrolstation

## Overview

This is a local UAV ground-control station with desktop, browser-serial, and Node/MAVLink runtimes. The principal workflow is operator connection to vehicle telemetry, protocol normalization, and presentation in the live dashboard; separate branches support target estimation from camera/gimbal and terrain data, frontend replay/simulation, and post-flight review. Paths and relationships for unsampled capabilities rely on the README or SOURCE INDEX; those files establish documented or referenced connections, not uninspected implementation details.

Main entry points: [`apps/web/src/App.tsx`](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/App.tsx) (Dashboard composition), [`apps/web/src/hooks/useReplayController.ts`](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useReplayController.ts) (Replay controller), [`apps/desktop/src-tauri/src/lib.rs`](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/desktop/src-tauri/src/lib.rs) (Desktop serial runtime), [`apps/web/src/hooks/useTargetEstimation.ts`](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useTargetEstimation.ts) (Estimation hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Connection runtimes"]
  node_desktop["Desktop serial runtime<br/>[lib.rs]"]
  node_desktop_crsf["CRSF framing<br/>[crsf.rs]"]
  node_desktop_dem["Terrain DEM access<br/>[dem.rs]"]
  node_server["Node server routes<br/>[buildApp.ts]"]
  node_server_mav["MAVLink serial service"]
  node_webserial["Browser serial link<br/>[webSerialLink.ts]"]
  node_telemetry_source["Telemetry source hook"]
end

subgraph group_dashboard["Operator dashboard"]
  node_dashboard_app["Dashboard composition<br/>[App.tsx]"]
  node_map["Live map<br/>[MapPanel.tsx]"]
  node_sidebar["Telemetry sidebar"]
  node_video_target["Video and target panel<br/>[VideoPanel.tsx]"]
end

subgraph group_telemetry["Telemetry model"]
  node_shared_model["Shared telemetry model<br/>[index.ts]"]
  node_telemetry_store["Telemetry state store<br/>[telemetryStore.ts]"]
end

subgraph group_replay["Replay and review"]
  node_replay_ui["Replay controls<br/>[ReplaySimPanel.tsx]"]
  node_replay_controller["Replay controller"]
  node_replay_parser["Log parser<br/>[parser.ts]"]
  node_replay_reconstruct["Event reconstruction<br/>[reconstruct.ts]"]
  node_simulation["Simulation generator<br/>[simulation.ts]"]
  node_review_analysis["Flight review analysis"]
  node_review_view["Flight review view"]
end

subgraph group_target["Target estimation"]
  node_target_hook["Estimation hook"]
  node_target_session["Estimation session<br/>[session.ts]"]
  node_target_estimator["Terrain ray estimator<br/>[estimateTarget.ts]"]
end

node_operator(("UAV operator"))
node_vehicle(("Flight controller / radio"))

node_operator -->|"connects through"| node_desktop
node_vehicle -->|"sends serial telemetry"| node_desktop
node_desktop -->|"uses framing"| node_desktop_crsf
node_desktop -->|"loads terrain"| node_desktop_dem
node_operator -->|"grants port"| node_webserial
node_vehicle -->|"sends serial telemetry"| node_webserial
node_operator -->|"connects through"| node_server
node_vehicle -->|"sends MAVLink"| node_server_mav
node_server -->|"routes to"| node_server_mav
node_server_mav -->|"applies MAVLink frames"| node_telemetry_store
node_desktop -->|"produces normalized state"| node_shared_model
node_server_mav -->|"updates shared state"| node_shared_model
node_telemetry_source -.->|"selects live source"| node_webserial
node_telemetry_source -.->|"supplies telemetry"| node_dashboard_app
node_dashboard_app -->|"renders"| node_map
node_dashboard_app -->|"renders"| node_sidebar
node_dashboard_app -->|"renders"| node_video_target
node_operator -->|"loads replay"| node_replay_ui
node_replay_ui -->|"controls"| node_replay_controller
node_replay_controller -->|"parses logs"| node_replay_parser
node_replay_controller -->|"folds events"| node_replay_reconstruct
node_replay_controller -->|"generates events"| node_simulation
node_replay_controller -.->|"feeds dashboard"| node_dashboard_app
node_dashboard_app -->|"requests analysis"| node_review_analysis
node_review_analysis -->|"reconstructs events"| node_replay_reconstruct
node_dashboard_app -->|"renders review"| node_review_view
node_operator -->|"configures estimation"| node_target_hook
node_target_hook -->|"updates session"| node_target_session
node_target_session -->|"estimates target"| node_target_estimator
node_target_hook -.->|"loads DEM terrain"| node_desktop_dem
node_dashboard_app -->|"requests estimate"| node_target_hook
node_target_hook -.->|"provides target result"| node_video_target

click node_desktop "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/desktop/src-tauri/src/lib.rs"
click node_desktop_crsf "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/desktop/src-tauri/src/crsf.rs"
click node_desktop_dem "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/desktop/src-tauri/src/dem.rs"
click node_server "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/server/src/buildApp.ts"
click node_server_mav "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/server/src/services/serialMavlinkService.ts"
click node_webserial "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/link/webSerialLink.ts"
click node_telemetry_source "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useTelemetrySource.ts"
click node_dashboard_app "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/App.tsx"
click node_map "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/MapPanel.tsx"
click node_sidebar "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/TelemetrySidebar.tsx"
click node_video_target "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/VideoPanel.tsx"
click node_shared_model "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/shared/src/index.ts"
click node_telemetry_store "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/shared/src/telemetry/telemetryStore.ts"
click node_replay_ui "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/ReplaySimPanel.tsx"
click node_replay_controller "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useReplayController.ts"
click node_replay_parser "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/replay/parser.ts"
click node_replay_reconstruct "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/replay/reconstruct.ts"
click node_simulation "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/replay/simulation.ts"
click node_review_analysis "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/flightReview/deriveFlightReview.ts"
click node_review_view "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/flightReview/FlightReviewView.tsx"
click node_target_hook "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useTargetEstimation.ts"
click node_target_session "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/target-estimation/src/session.ts"
click node_target_estimator "https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/target-estimation/src/estimateTarget.ts"

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_desktop,node_desktop_crsf,node_desktop_dem,node_server,node_server_mav,node_webserial,node_telemetry_source toneBlue
class node_dashboard_app,node_map,node_sidebar,node_video_target toneAmber
class node_shared_model,node_telemetry_store toneMint
class node_replay_ui,node_replay_controller,node_replay_parser,node_replay_reconstruct,node_simulation,node_review_analysis,node_review_view toneRose
class node_target_hook,node_target_session,node_target_estimator,node_operator,node_vehicle toneIndigo
```

## Components

### Connection runtimes

- [Desktop serial runtime](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/desktop/src-tauri/src/lib.rs): `apps/desktop/src-tauri/src/lib.rs`
- [CRSF framing](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/desktop/src-tauri/src/crsf.rs): `apps/desktop/src-tauri/src/crsf.rs`
- [Terrain DEM access](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/desktop/src-tauri/src/dem.rs): `apps/desktop/src-tauri/src/dem.rs`
- [Node server routes](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/server/src/buildApp.ts): `apps/server/src/buildApp.ts`
- [MAVLink serial service](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/server/src/services/serialMavlinkService.ts): `apps/server/src/services/serialMavlinkService.ts`
- [Browser serial link](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/link/webSerialLink.ts): `apps/web/src/link/webSerialLink.ts`
- [Telemetry source hook](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useTelemetrySource.ts): `apps/web/src/hooks/useTelemetrySource.ts`

### Operator dashboard

- [Dashboard composition](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Live map](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/MapPanel.tsx): `apps/web/src/components/MapPanel.tsx`
- [Telemetry sidebar](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/TelemetrySidebar.tsx): `apps/web/src/components/TelemetrySidebar.tsx`
- [Video and target panel](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/VideoPanel.tsx): `apps/web/src/components/VideoPanel.tsx`

### Telemetry model

- [Shared telemetry model](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/shared/src/index.ts): `packages/shared/src/index.ts`
- [Telemetry state store](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/shared/src/telemetry/telemetryStore.ts): `packages/shared/src/telemetry/telemetryStore.ts`

### Replay and review

- [Replay controls](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/ReplaySimPanel.tsx): `apps/web/src/components/ReplaySimPanel.tsx`
- [Replay controller](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useReplayController.ts): `apps/web/src/hooks/useReplayController.ts`
- [Log parser](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/replay/parser.ts): `apps/web/src/replay/parser.ts`
- [Event reconstruction](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/replay/reconstruct.ts): `apps/web/src/replay/reconstruct.ts`
- [Simulation generator](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/replay/simulation.ts): `apps/web/src/replay/simulation.ts`
- [Flight review analysis](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/flightReview/deriveFlightReview.ts): `apps/web/src/flightReview/deriveFlightReview.ts`
- [Flight review view](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/components/flightReview/FlightReviewView.tsx): `apps/web/src/components/flightReview/FlightReviewView.tsx`

### Target estimation

- [Estimation hook](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/apps/web/src/hooks/useTargetEstimation.ts): `apps/web/src/hooks/useTargetEstimation.ts`
- [Estimation session](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/target-estimation/src/session.ts): `packages/target-estimation/src/session.ts`
- [Terrain ray estimator](https://github.com/gitfeber/uavgroundcontrolstation/blob/main/packages/target-estimation/src/estimateTarget.ts): `packages/target-estimation/src/estimateTarget.ts`

### Other components

- **UAV operator**
- **Flight controller / radio**

## Connections

- UAV operator → Desktop serial runtime: connects through (evidence: `README.md`)
- Flight controller / radio → Desktop serial runtime: sends serial telemetry (evidence: `README.md`)
- Desktop serial runtime → CRSF framing: uses framing (evidence: `apps/desktop/src-tauri/src/lib.rs`)
- Desktop serial runtime → Terrain DEM access: loads terrain (evidence: `apps/desktop/src-tauri/src/lib.rs`)
- UAV operator → Browser serial link: grants port (evidence: `README.md`)
- Flight controller / radio → Browser serial link: sends serial telemetry (evidence: `README.md`)
- UAV operator → Node server routes: connects through (evidence: `README.md`)
- Flight controller / radio → MAVLink serial service: sends MAVLink (evidence: `README.md`)
- Node server routes → MAVLink serial service: routes to (evidence: `apps/server/src/buildApp.ts`)
- MAVLink serial service → Telemetry state store: applies MAVLink frames (evidence: `apps/server/src/services/serialMavlinkService.ts`)
- Desktop serial runtime → Shared telemetry model: produces normalized state (evidence: `README.md`)
- MAVLink serial service → Shared telemetry model: updates shared state (evidence: `apps/server/src/services/serialMavlinkService.ts`)
- Telemetry source hook → Browser serial link: selects live source
- Telemetry source hook → Dashboard composition: supplies telemetry (evidence: `apps/web/src/App.tsx`)
- Dashboard composition → Live map: renders (evidence: `apps/web/src/App.tsx`)
- Dashboard composition → Telemetry sidebar: renders (evidence: `apps/web/src/App.tsx`)
- Dashboard composition → Video and target panel: renders (evidence: `apps/web/src/App.tsx`)
- UAV operator → Replay controls: loads replay (evidence: `README.md`)
- Replay controls → Replay controller: controls (evidence: `apps/web/src/components/ReplaySimPanel.tsx`)
- Replay controller → Log parser: parses logs (evidence: `apps/web/src/hooks/useReplayController.ts`)
- Replay controller → Event reconstruction: folds events (evidence: `apps/web/src/hooks/useReplayController.ts`)
- Replay controller → Simulation generator: generates events (evidence: `apps/web/src/hooks/useReplayController.ts`)
- Replay controller → Dashboard composition: feeds dashboard
- Dashboard composition → Flight review analysis: requests analysis (evidence: `apps/web/src/App.tsx`)
- Flight review analysis → Event reconstruction: reconstructs events (evidence: `apps/web/src/flightReview/deriveFlightReview.ts`)
- Dashboard composition → Flight review view: renders review (evidence: `apps/web/src/App.tsx`)
- UAV operator → Estimation hook: configures estimation (evidence: `README.md`)
- Estimation hook → Estimation session: updates session (evidence: `apps/web/src/hooks/useTargetEstimation.ts`)
- Estimation session → Terrain ray estimator: estimates target (evidence: `packages/target-estimation/src/session.ts`)
- Estimation hook → Terrain DEM access: loads DEM terrain
- Dashboard composition → Estimation hook: requests estimate (evidence: `apps/web/src/App.tsx`)
- Estimation hook → Video and target panel: provides target result
