# mustafaklee/uav-ground-control-station architecture

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

- Interactive diagram: https://gitdiagram.com/mustafaklee/uav-ground-control-station
- Repository: https://github.com/mustafaklee/uav-ground-control-station

## Overview

This is a modular UAV ground-control station: operators register vehicles, establish MAVLink links, monitor telemetry, plan and upload missions, and send authorized, audited commands. The principal workflow runs from the Avalonia desktop through REST/SignalR APIs and application handlers to domain rules and MAVLink or persistence adapters. Separate branches cover sign-in, fleet management, topology, telemetry history, event delivery, and simulation. Relationships are based on README architecture and capability statements plus the supplied source index and excerpts; unsampled internals are represented at subsystem level.

Main entry points: [`src/Gcs.Api/Program.cs`](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Api/Program.cs) (HTTP API), [`src/Gcs.Mavlink/Connections/VehicleLinkManager.cs`](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Connections/VehicleLinkManager.cs) (MAVLink links), [`src/Gcs.Application/Missions/MissionHandlers.cs`](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Missions/MissionHandlers.cs) (Mission planning), [`src/Gcs.Persistence/GcsDbContext.cs`](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Persistence/GcsDbContext.cs) (PostgreSQL persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Operator client"]
  node_desktop["Avalonia desktop<br/>[App.axaml.cs]"]
end

subgraph group_service["API and application"]
  node_api["HTTP API<br/>[Program.cs]"]
  node_auth["Authentication<br/>[AuthHandlers.cs]"]
  node_fleet["Vehicle management"]
  node_links["Vehicle links"]
  node_missions["Mission planning<br/>[MissionHandlers.cs]"]
  node_commands["Command handling<br/>[CommandHandlers.cs]"]
  node_topology["Network topology"]
end

subgraph group_domain["Flight domain"]
  node_vehicle["Vehicle rules<br/>[Vehicle.cs]"]
  node_mission["Mission rules<br/>[Mission.cs]"]
  node_user["User security rules<br/>[User.cs]"]
end

subgraph group_adapters["Runtime adapters"]
  node_mavlink["MAVLink links"]
  node_protocol["MAVLink protocol"]
  node_telemetry["Telemetry pipeline"]
  node_realtime["Live updates"]
  node_transfer["Mission transfer<br/>[MissionTransfer.cs]"]
  node_simulator["Vehicle simulator"]
end

subgraph group_state["State and events"]
  node_persistence[("PostgreSQL persistence<br/>[GcsDbContext.cs]")]
  node_outbox["Outbox dispatch"]
  node_messaging["RabbitMQ events"]
end

node_operator(("Operator"))
node_aircraft{{"UAV / PX4"}}

node_operator -->|"operates"| node_desktop
node_desktop -->|"REST requests"| node_api
node_desktop -->|"SignalR updates"| node_realtime
node_api -->|"routes requests"| node_auth
node_api -->|"routes requests"| node_fleet
node_api -->|"routes requests"| node_links
node_api -->|"routes requests"| node_missions
node_api -->|"routes requests"| node_commands
node_api -->|"routes requests"| node_topology
node_auth -->|"applies rules"| node_user
node_fleet -->|"applies rules"| node_vehicle
node_links -->|"updates link intent"| node_vehicle
node_missions -->|"validates plans"| node_mission
node_commands -->|"sends commands"| node_mavlink
node_missions -->|"uploads missions"| node_transfer
node_links -.->|"controls links"| node_mavlink
node_mavlink -->|"parses frames"| node_protocol
node_mavlink -->|"communicates MAVLink"| node_aircraft
node_simulator -.->|"simulates link"| node_mavlink
node_mavlink -->|"feeds telemetry"| node_telemetry
node_telemetry -->|"publishes live state"| node_realtime
node_telemetry -->|"stores history"| node_persistence
node_fleet -.->|"reads and writes"| node_persistence
node_missions -->|"reads and writes"| node_persistence
node_persistence -->|"stores events"| node_outbox
node_outbox -->|"publishes events"| node_messaging
node_topology -.->|"reads topology"| node_mavlink

click node_desktop "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Desktop/App.axaml.cs"
click node_api "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Api/Program.cs"
click node_auth "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Security/AuthHandlers.cs"
click node_fleet "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Vehicles/VehicleQueryHandlers.cs"
click node_links "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Vehicles/VehicleLinkHandlers.cs"
click node_missions "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Missions/MissionHandlers.cs"
click node_commands "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Commands/CommandHandlers.cs"
click node_topology "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Network/GetNetworkTopologyHandler.cs"
click node_vehicle "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Domain/Vehicles/Vehicle.cs"
click node_mission "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Domain/Missions/Mission.cs"
click node_user "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Domain/Users/User.cs"
click node_mavlink "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Connections/VehicleLinkManager.cs"
click node_protocol "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Protocol/MavlinkFrameParser.cs"
click node_telemetry "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Telemetry/TelemetryPipeline.cs"
click node_realtime "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Api/Realtime/SignalRLiveUpdatePublisher.cs"
click node_transfer "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Missions/MissionTransfer.cs"
click node_persistence "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Persistence/GcsDbContext.cs"
click node_outbox "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Infrastructure/Outbox/OutboxDispatcher.cs"
click node_messaging "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Messaging/RabbitMqEventPublisher.cs"
click node_simulator "https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Simulation/SimulatedVehicleRunner.cs"

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 toneBlue
class node_api,node_auth,node_fleet,node_links,node_missions,node_commands,node_topology toneAmber
class node_vehicle,node_mission,node_user toneMint
class node_mavlink,node_protocol,node_telemetry,node_realtime,node_transfer,node_simulator toneRose
class node_persistence,node_outbox,node_messaging,node_operator,node_aircraft toneIndigo
```

## Components

### Operator client

- [Avalonia desktop](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Desktop/App.axaml.cs): `src/Gcs.Desktop/App.axaml.cs`

### API and application

- [HTTP API](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Api/Program.cs): `src/Gcs.Api/Program.cs`
- [Authentication](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Security/AuthHandlers.cs): `src/Gcs.Application/Security/AuthHandlers.cs`
- [Vehicle management](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Vehicles/VehicleQueryHandlers.cs): `src/Gcs.Application/Vehicles/VehicleQueryHandlers.cs`
- [Vehicle links](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Vehicles/VehicleLinkHandlers.cs): `src/Gcs.Application/Vehicles/VehicleLinkHandlers.cs`
- [Mission planning](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Missions/MissionHandlers.cs): `src/Gcs.Application/Missions/MissionHandlers.cs`
- [Command handling](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Commands/CommandHandlers.cs): `src/Gcs.Application/Commands/CommandHandlers.cs`
- [Network topology](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Application/Network/GetNetworkTopologyHandler.cs): `src/Gcs.Application/Network/GetNetworkTopologyHandler.cs`

### Flight domain

- [Vehicle rules](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Domain/Vehicles/Vehicle.cs): `src/Gcs.Domain/Vehicles/Vehicle.cs`
- [Mission rules](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Domain/Missions/Mission.cs): `src/Gcs.Domain/Missions/Mission.cs`
- [User security rules](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Domain/Users/User.cs): `src/Gcs.Domain/Users/User.cs`

### Runtime adapters

- [MAVLink links](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Connections/VehicleLinkManager.cs): `src/Gcs.Mavlink/Connections/VehicleLinkManager.cs`
- [MAVLink protocol](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Protocol/MavlinkFrameParser.cs): `src/Gcs.Mavlink/Protocol/MavlinkFrameParser.cs`
- [Telemetry pipeline](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Telemetry/TelemetryPipeline.cs): `src/Gcs.Telemetry/TelemetryPipeline.cs`
- [Live updates](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Api/Realtime/SignalRLiveUpdatePublisher.cs): `src/Gcs.Api/Realtime/SignalRLiveUpdatePublisher.cs`
- [Mission transfer](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Missions/MissionTransfer.cs): `src/Gcs.Mavlink/Missions/MissionTransfer.cs`
- [Vehicle simulator](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Mavlink/Simulation/SimulatedVehicleRunner.cs): `src/Gcs.Mavlink/Simulation/SimulatedVehicleRunner.cs`

### State and events

- [PostgreSQL persistence](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Persistence/GcsDbContext.cs): `src/Gcs.Persistence/GcsDbContext.cs`
- [Outbox dispatch](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Infrastructure/Outbox/OutboxDispatcher.cs): `src/Gcs.Infrastructure/Outbox/OutboxDispatcher.cs`
- [RabbitMQ events](https://github.com/mustafaklee/uav-ground-control-station/blob/main/src/Gcs.Messaging/RabbitMqEventPublisher.cs): `src/Gcs.Messaging/RabbitMqEventPublisher.cs`

### Other components

- **Operator**
- **UAV / PX4**

## Connections

- Operator → Avalonia desktop: operates (evidence: `README.md`)
- Avalonia desktop → HTTP API: REST requests (evidence: `README.md`)
- Avalonia desktop → Live updates: SignalR updates (evidence: `README.md`)
- HTTP API → Authentication: routes requests (evidence: `README.md`)
- HTTP API → Vehicle management: routes requests (evidence: `README.md`)
- HTTP API → Vehicle links: routes requests (evidence: `README.md`)
- HTTP API → Mission planning: routes requests (evidence: `README.md`)
- HTTP API → Command handling: routes requests (evidence: `README.md`)
- HTTP API → Network topology: routes requests (evidence: `README.md`)
- Authentication → User security rules: applies rules (evidence: `src/Gcs.Application/Security/AuthHandlers.cs`)
- Vehicle management → Vehicle rules: applies rules (evidence: `src/Gcs.Application/Vehicles/VehicleQueryHandlers.cs`)
- Vehicle links → Vehicle rules: updates link intent (evidence: `src/Gcs.Application/Vehicles/VehicleLinkHandlers.cs`)
- Mission planning → Mission rules: validates plans (evidence: `src/Gcs.Domain/Missions/Mission.cs`)
- Command handling → MAVLink links: sends commands
- Mission planning → Mission transfer: uploads missions
- Vehicle links → MAVLink links: controls links
- MAVLink links → MAVLink protocol: parses frames (evidence: `src/Gcs.Mavlink/Connections/VehicleLinkManager.cs`)
- MAVLink links → UAV / PX4: communicates MAVLink (evidence: `README.md`)
- Vehicle simulator → MAVLink links: simulates link
- MAVLink links → Telemetry pipeline: feeds telemetry (evidence: `README.md`)
- Telemetry pipeline → Live updates: publishes live state (evidence: `README.md`)
- Telemetry pipeline → PostgreSQL persistence: stores history (evidence: `README.md`)
- Vehicle management → PostgreSQL persistence: reads and writes
- Mission planning → PostgreSQL persistence: reads and writes
- PostgreSQL persistence → Outbox dispatch: stores events (evidence: `src/Gcs.Persistence/GcsDbContext.cs`)
- Outbox dispatch → RabbitMQ events: publishes events (evidence: `README.md`)
- Network topology → MAVLink links: reads topology
