# stpaine/fers architecture

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

- Interactive diagram: https://gitdiagram.com/stpaine/fers
- Repository: https://github.com/stpaine/fers

## Overview

FERS is a radar-simulation suite: users configure scenarios in the desktop UI or run them through the CLI, then simulate and export receiver data. The README documents the major simulation modes and output formats; sampled source confirms frontend startup, scenario-driven visualization, CLI delegation, and HDF5 handling. The schema package is described in the README but is absent from the supplied tree, so it is not mapped. Engine wiring beyond the documented API boundary is kept deliberately broad.

Main entry points: [`packages/libfers/src/processing/finalizer_pipeline.cpp`](https://github.com/stpaine/fers/blob/master/packages/libfers/src/processing/finalizer_pipeline.cpp) (Signal processing), [`packages/fers-ui/src/stores/scenarioStore/index.ts`](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/stores/scenarioStore/index.ts) (Scenario state), [`packages/libfers/src/core/world.cpp`](https://github.com/stpaine/fers/blob/master/packages/libfers/src/core/world.cpp) (Simulation world), [`packages/fers-ui/src-tauri/src/fers_api.rs`](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src-tauri/src/fers_api.rs) (Desktop bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop application"]
  node_app["UI shell<br/>[App.tsx]"]
  node_scenario["Scenario editor<br/>[ScenarioView.tsx]"]
  node_state["Scenario state<br/>[index.ts]"]
  node_visualization["3D visualization<br/>[WorldView.tsx]"]
  node_streamview["VITA streaming view"]
end

subgraph group_entry["Runtime entry points"]
  node_tauri["Desktop bridge<br/>[fers_api.rs]"]
  node_cli["CLI runner<br/>[cli_runner.cpp]"]
  node_api["C API<br/>[api.cpp]"]
end

subgraph group_engine["Simulation engine"]
  node_radarmodel["Radar models"]
  node_simulation["Simulation world<br/>[world.cpp]"]
  node_signal["Signal processing"]
end

subgraph group_formats["Inputs and outputs"]
  node_waveforms["Waveform handling"]
  node_hdf5["HDF5 I/O<br/>[hdf5_handler.cpp]"]
  node_vita["VITA 49.2 output"]
  node_kml["KML generation<br/>[kml_generator.cpp]"]
end

node_user(("Scenario user"))
node_receiverdata["Receiver results"]
node_externalconsumer(("UDP consumers"))
node_mappingtool(("Geographic tools"))

node_user -->|"uses"| node_app
node_app -->|"presents"| node_scenario
node_scenario -->|"updates"| node_state
node_state -->|"drives"| node_visualization
node_state -->|"invokes commands"| node_tauri
node_streamview -->|"invokes commands"| node_tauri
node_tauri -->|"calls"| node_api
node_user -->|"runs"| node_cli
node_cli -->|"calls"| node_api
node_api -->|"runs simulation"| node_simulation
node_simulation -->|"models scenario"| node_radarmodel
node_simulation -->|"produces receiver signals"| node_signal
node_waveforms -.->|"loads sampled data"| node_hdf5
node_signal -->|"writes receiver data"| node_hdf5
node_signal -->|"streams signal data"| node_vita
node_signal -->|"exports scenario"| node_kml
node_hdf5 -->|"writes"| node_receiverdata
node_vita -->|"sends UDP packets"| node_externalconsumer
node_kml -->|"writes KML for"| node_mappingtool

click node_app "https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/App.tsx"
click node_scenario "https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/views/ScenarioView.tsx"
click node_state "https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/stores/scenarioStore/index.ts"
click node_visualization "https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/components/WorldView.tsx"
click node_streamview "https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/views/Vita49StreamingView.tsx"
click node_tauri "https://github.com/stpaine/fers/blob/master/packages/fers-ui/src-tauri/src/fers_api.rs"
click node_cli "https://github.com/stpaine/fers/blob/master/packages/fers-cli/src/cli_runner.cpp"
click node_api "https://github.com/stpaine/fers/blob/master/packages/libfers/src/api.cpp"
click node_radarmodel "https://github.com/stpaine/fers/tree/master/packages/libfers/src/radar"
click node_simulation "https://github.com/stpaine/fers/blob/master/packages/libfers/src/core/world.cpp"
click node_signal "https://github.com/stpaine/fers/blob/master/packages/libfers/src/processing/finalizer_pipeline.cpp"
click node_waveforms "https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/waveform_factory.cpp"
click node_hdf5 "https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/hdf5_handler.cpp"
click node_vita "https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/vita49/vita49_output_sink.cpp"
click node_kml "https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/kml_generator.cpp"

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,node_scenario,node_state,node_visualization,node_streamview,node_user toneBlue
class node_tauri,node_cli,node_api toneAmber
class node_radarmodel,node_simulation,node_signal toneMint
class node_waveforms,node_hdf5,node_vita,node_kml toneRose
class node_receiverdata,node_externalconsumer,node_mappingtool toneIndigo
```

## Components

### Desktop application

- [UI shell](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/App.tsx): `packages/fers-ui/src/App.tsx`
- [Scenario editor](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/views/ScenarioView.tsx): `packages/fers-ui/src/views/ScenarioView.tsx`
- [Scenario state](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/stores/scenarioStore/index.ts): `packages/fers-ui/src/stores/scenarioStore/index.ts`
- [3D visualization](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/components/WorldView.tsx): `packages/fers-ui/src/components/WorldView.tsx`
- [VITA streaming view](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src/views/Vita49StreamingView.tsx): `packages/fers-ui/src/views/Vita49StreamingView.tsx`

### Runtime entry points

- [Desktop bridge](https://github.com/stpaine/fers/blob/master/packages/fers-ui/src-tauri/src/fers_api.rs): `packages/fers-ui/src-tauri/src/fers_api.rs`
- [CLI runner](https://github.com/stpaine/fers/blob/master/packages/fers-cli/src/cli_runner.cpp): `packages/fers-cli/src/cli_runner.cpp`
- [C API](https://github.com/stpaine/fers/blob/master/packages/libfers/src/api.cpp): `packages/libfers/src/api.cpp`

### Simulation engine

- [Radar models](https://github.com/stpaine/fers/tree/master/packages/libfers/src/radar): `packages/libfers/src/radar`
- [Simulation world](https://github.com/stpaine/fers/blob/master/packages/libfers/src/core/world.cpp): `packages/libfers/src/core/world.cpp`
- [Signal processing](https://github.com/stpaine/fers/blob/master/packages/libfers/src/processing/finalizer_pipeline.cpp): `packages/libfers/src/processing/finalizer_pipeline.cpp`

### Inputs and outputs

- [Waveform handling](https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/waveform_factory.cpp): `packages/libfers/src/serial/waveform_factory.cpp`
- [HDF5 I/O](https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/hdf5_handler.cpp): `packages/libfers/src/serial/hdf5_handler.cpp`
- [VITA 49.2 output](https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/vita49/vita49_output_sink.cpp): `packages/libfers/src/serial/vita49/vita49_output_sink.cpp`
- [KML generation](https://github.com/stpaine/fers/blob/master/packages/libfers/src/serial/kml_generator.cpp): `packages/libfers/src/serial/kml_generator.cpp`

### Other components

- **Scenario user**
- **Receiver results**
- **UDP consumers**
- **Geographic tools**

## Connections

- Scenario user → UI shell: uses
- UI shell → Scenario editor: presents
- Scenario editor → Scenario state: updates
- Scenario state → 3D visualization: drives
- Scenario state → Desktop bridge: invokes commands
- VITA streaming view → Desktop bridge: invokes commands
- Desktop bridge → C API: calls
- Scenario user → CLI runner: runs
- CLI runner → C API: calls
- C API → Simulation world: runs simulation
- Simulation world → Radar models: models scenario
- Simulation world → Signal processing: produces receiver signals
- Waveform handling → HDF5 I/O: loads sampled data
- Signal processing → HDF5 I/O: writes receiver data
- Signal processing → VITA 49.2 output: streams signal data
- Signal processing → KML generation: exports scenario
- HDF5 I/O → Receiver results: writes
- VITA 49.2 output → UDP consumers: sends UDP packets
- KML generation → Geographic tools: writes KML for
