# edgetx/edgetx architecture

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

- Interactive diagram: https://gitdiagram.com/edgetx/edgetx
- Repository: https://github.com/edgetx/edgetx

## Overview

EdgeTX is radio-control firmware, accompanied by Companion desktop tools and a browser-based WebAssembly interface. The central radio workflow is user input and model configuration → firmware processing → radio outputs and persistent settings. The repository also includes Companion model editing, file-format handling, firmware operations, and simulation, plus web filesystem support. The excerpts and source index show selected storage, SD-manager, and browser-worker relationships; several major subsystems are represented by tree paths or documented purpose, so their internal links are omitted rather than inferred.

Main entry points: [`companion/src/mainwindow.h`](https://github.com/edgetx/edgetx/blob/main/companion/src/mainwindow.h) (Companion app), [`radio/src/edgetx.h`](https://github.com/edgetx/edgetx/blob/main/radio/src/edgetx.h) (Model runtime), [`web/src/App.svelte`](https://github.com/edgetx/edgetx/blob/main/web/src/App.svelte) (Web app), [`radio/src/gui/colorlcd/radio/radio_sdmanager.cpp`](https://github.com/edgetx/edgetx/blob/main/radio/src/gui/colorlcd/radio/radio_sdmanager.cpp) (Radio UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_radio["Radio firmware"]
  node_radio_ui["Radio UI"]
  node_model_runtime["Model runtime<br/>[edgetx.h]"]
  node_radio_state["Radio state<br/>[storage_common.cpp]"]
  node_radio_sd["SD manager"]
  node_usb_storage["USB mass storage"]
end

subgraph group_companion["Companion desktop"]
  node_companion_app["Companion app<br/>[mainwindow.h]"]
  node_model_editor["Model editor<br/>[modeledit.cpp]"]
  node_radio_models[("Radio models<br/>[modeldata.cpp]")]
  node_file_formats["File formats<br/>[storage.cpp]"]
  node_firmware_tools["Firmware tools"]
  node_simulator["Radio simulator"]
end

subgraph group_web["Web interface"]
  node_web_app["Web app<br/>[App.svelte]"]
  node_wasm_runner["WASM runner<br/>[wasm-runner.ts]"]
  node_fs_client["Filesystem client<br/>[fs-proxy-client.ts]"]
  node_fs_worker["Filesystem worker<br/>[fs-worker.ts]"]
  node_opfs[("OPFS backend<br/>[opfs-backend.ts]")]
end

subgraph group_shared["Persistence and hardware"]
  node_disk_driver["Disk driver<br/>[storage.cpp]"]
  node_fatfs[("FatFs storage<br/>[ff.h]")]
end

node_pilot(("Radio user"))

node_pilot -.->|"operates"| node_radio_ui
node_radio_ui -.->|"configures"| node_model_runtime
node_model_runtime -.->|"persists state"| node_radio_state
node_radio_sd -->|"starts OTA update"| node_model_runtime
node_usb_storage -->|"reads and writes"| node_disk_driver
node_disk_driver -->|"registers driver"| node_fatfs
node_companion_app -.->|"opens editor"| node_model_editor
node_model_editor -.->|"edits model data"| node_radio_models
node_companion_app -.->|"loads and saves"| node_file_formats
node_companion_app -.->|"offers flashing"| node_firmware_tools
node_companion_app -.->|"offers simulation"| node_simulator
node_web_app -->|"runs firmware"| node_wasm_runner
node_web_app -.->|"uses filesystem"| node_fs_client
node_fs_client -->|"sends requests"| node_fs_worker
node_fs_worker -->|"uses backend"| node_opfs

click node_radio_ui "https://github.com/edgetx/edgetx/blob/main/radio/src/gui/colorlcd/radio/radio_sdmanager.cpp"
click node_model_runtime "https://github.com/edgetx/edgetx/blob/main/radio/src/edgetx.h"
click node_radio_state "https://github.com/edgetx/edgetx/blob/main/radio/src/storage/storage_common.cpp"
click node_radio_sd "https://github.com/edgetx/edgetx/blob/main/radio/src/gui/common/stdlcd/radio_sdmanager.cpp"
click node_usb_storage "https://github.com/edgetx/edgetx/blob/main/radio/src/targets/common/arm/stm32/usbd_storage_msd.cpp"
click node_disk_driver "https://github.com/edgetx/edgetx/blob/main/radio/src/hal/storage.cpp"
click node_fatfs "https://github.com/edgetx/edgetx/blob/main/radio/src/thirdparty/FatFs/ff.h"
click node_companion_app "https://github.com/edgetx/edgetx/blob/main/companion/src/mainwindow.h"
click node_model_editor "https://github.com/edgetx/edgetx/blob/main/companion/src/modeledit/modeledit.cpp"
click node_radio_models "https://github.com/edgetx/edgetx/blob/main/companion/src/firmwares/modeldata.cpp"
click node_file_formats "https://github.com/edgetx/edgetx/blob/main/companion/src/storage/storage.cpp"
click node_firmware_tools "https://github.com/edgetx/edgetx/blob/main/companion/src/flash/flashfirmwaredialog.cpp"
click node_simulator "https://github.com/edgetx/edgetx/blob/main/companion/src/simulation/wasmsimulatorinterface.cpp"
click node_web_app "https://github.com/edgetx/edgetx/blob/main/web/src/App.svelte"
click node_wasm_runner "https://github.com/edgetx/edgetx/blob/main/web/src/lib/wasm-runner.ts"
click node_fs_client "https://github.com/edgetx/edgetx/blob/main/web/src/lib/fs-proxy-client.ts"
click node_fs_worker "https://github.com/edgetx/edgetx/blob/main/web/src/lib/fs-worker.ts"
click node_opfs "https://github.com/edgetx/edgetx/blob/main/web/src/lib/opfs-backend.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_radio_ui,node_model_runtime,node_radio_state,node_radio_sd,node_usb_storage,node_pilot toneBlue
class node_companion_app,node_model_editor,node_radio_models,node_file_formats,node_firmware_tools,node_simulator toneAmber
class node_web_app,node_wasm_runner,node_fs_client,node_fs_worker,node_opfs toneMint
class node_disk_driver,node_fatfs toneRose
```

## Components

### Radio firmware

- [Radio UI](https://github.com/edgetx/edgetx/blob/main/radio/src/gui/colorlcd/radio/radio_sdmanager.cpp): `radio/src/gui/colorlcd/radio/radio_sdmanager.cpp`
- [Model runtime](https://github.com/edgetx/edgetx/blob/main/radio/src/edgetx.h): `radio/src/edgetx.h`
- [Radio state](https://github.com/edgetx/edgetx/blob/main/radio/src/storage/storage_common.cpp): `radio/src/storage/storage_common.cpp`
- [SD manager](https://github.com/edgetx/edgetx/blob/main/radio/src/gui/common/stdlcd/radio_sdmanager.cpp): `radio/src/gui/common/stdlcd/radio_sdmanager.cpp`
- [USB mass storage](https://github.com/edgetx/edgetx/blob/main/radio/src/targets/common/arm/stm32/usbd_storage_msd.cpp): `radio/src/targets/common/arm/stm32/usbd_storage_msd.cpp`

### Companion desktop

- [Companion app](https://github.com/edgetx/edgetx/blob/main/companion/src/mainwindow.h): `companion/src/mainwindow.h`
- [Model editor](https://github.com/edgetx/edgetx/blob/main/companion/src/modeledit/modeledit.cpp): `companion/src/modeledit/modeledit.cpp`
- [Radio models](https://github.com/edgetx/edgetx/blob/main/companion/src/firmwares/modeldata.cpp): `companion/src/firmwares/modeldata.cpp`
- [File formats](https://github.com/edgetx/edgetx/blob/main/companion/src/storage/storage.cpp): `companion/src/storage/storage.cpp`
- [Firmware tools](https://github.com/edgetx/edgetx/blob/main/companion/src/flash/flashfirmwaredialog.cpp): `companion/src/flash/flashfirmwaredialog.cpp`
- [Radio simulator](https://github.com/edgetx/edgetx/blob/main/companion/src/simulation/wasmsimulatorinterface.cpp): `companion/src/simulation/wasmsimulatorinterface.cpp`

### Web interface

- [Web app](https://github.com/edgetx/edgetx/blob/main/web/src/App.svelte): `web/src/App.svelte`
- [WASM runner](https://github.com/edgetx/edgetx/blob/main/web/src/lib/wasm-runner.ts): `web/src/lib/wasm-runner.ts`
- [Filesystem client](https://github.com/edgetx/edgetx/blob/main/web/src/lib/fs-proxy-client.ts): `web/src/lib/fs-proxy-client.ts`
- [Filesystem worker](https://github.com/edgetx/edgetx/blob/main/web/src/lib/fs-worker.ts): `web/src/lib/fs-worker.ts`
- [OPFS backend](https://github.com/edgetx/edgetx/blob/main/web/src/lib/opfs-backend.ts): `web/src/lib/opfs-backend.ts`

### Persistence and hardware

- [Disk driver](https://github.com/edgetx/edgetx/blob/main/radio/src/hal/storage.cpp): `radio/src/hal/storage.cpp`
- [FatFs storage](https://github.com/edgetx/edgetx/blob/main/radio/src/thirdparty/FatFs/ff.h): `radio/src/thirdparty/FatFs/ff.h`

### Other components

- **Radio user**

## Connections

- Radio user → Radio UI: operates
- Radio UI → Model runtime: configures (evidence: `radio/src/gui/colorlcd/radio/radio_sdmanager.cpp`)
- Model runtime → Radio state: persists state (evidence: `radio/src/storage/storage_common.cpp`)
- SD manager → Model runtime: starts OTA update (evidence: `radio/src/gui/common/stdlcd/radio_sdmanager.cpp`)
- USB mass storage → Disk driver: reads and writes (evidence: `radio/src/targets/common/arm/stm32/usbd_storage_msd.cpp`)
- Disk driver → FatFs storage: registers driver (evidence: `radio/src/hal/storage.cpp`)
- Companion app → Model editor: opens editor
- Model editor → Radio models: edits model data
- Companion app → File formats: loads and saves
- Companion app → Firmware tools: offers flashing
- Companion app → Radio simulator: offers simulation
- Web app → WASM runner: runs firmware (evidence: `web/src/App.svelte`)
- Web app → Filesystem client: uses filesystem
- Filesystem client → Filesystem worker: sends requests
- Filesystem worker → OPFS backend: uses backend (evidence: `web/src/lib/fs-worker.ts`)
