# digao791/radar-system architecture

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

- Interactive diagram: https://gitdiagram.com/digao791/radar-system
- Repository: https://github.com/digao791/radar-system

## Overview

Radar System simulates moving targets, detects those within configured range, and serves radar state to a React dashboard. The main user flow is browser dashboard polling and issuing pause/resume commands through the JSON API; the dashboard renders detections, configuration, status, and target details. Backend internals are not excerpted, so their links follow the README’s documented architecture and API overview rather than inspected call sites. The separate map component is present in the tree and excerpted, but its connection to the dashboard is not shown.

Main entry points: [`frontend/src/App.tsx`](https://github.com/digao791/radar-system/blob/main/frontend/src/App.tsx) (Dashboard state), [`src/impl/radar-service.adb`](https://github.com/digao791/radar-system/blob/main/src/impl/radar-service.adb) (Radar service), [`src/impl/radar-engine.adb`](https://github.com/digao791/radar-system/blob/main/src/impl/radar-engine.adb) (Simulation engine), [`src/impl/radar-simulation.adb`](https://github.com/digao791/radar-system/blob/main/src/impl/radar-simulation.adb) (Target simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_app["Dashboard state<br/>[App.tsx]"]
  node_api_client["Radar API client<br/>[radarApi.ts]"]
  node_display["Radar display<br/>[RadarDisplay.tsx]"]
  node_map["Map overlay<br/>[RadarMap.tsx]"]
  node_types["Radar data types<br/>[radar.ts]"]
end

subgraph group_api["HTTP API"]
  node_http_server["HTTP server<br/>[radar_http.adb]"]
  node_routes["API routes<br/>[radar-routes.adb]"]
  node_handlers["API handlers<br/>[radar-handlers.adb]"]
  node_config_handler["Configuration handler"]
  node_detection_handler["Detection handler"]
  node_targets_handler["Targets handler"]
end

subgraph group_simulation["Simulation"]
  node_service["Radar service<br/>[radar-service.adb]"]
  node_engine["Simulation engine<br/>[radar-engine.adb]"]
  node_shared_state[("Shared state")]
  node_simulation_loop["Target simulation"]
  node_generator["Target generation"]
end

subgraph group_radar["Radar Logic"]
  node_targets["Target movement<br/>[radar-targets.adb]"]
  node_detection["Range detection"]
  node_configuration["Radar configuration"]
  node_control["Engine controls<br/>[radar-control.adb]"]
end

node_browser(("Web browser"))

node_browser -->|"uses dashboard"| node_app
node_app -->|"polls and controls"| node_api_client
node_app -->|"renders detections"| node_display
node_app -->|"uses data types"| node_types
node_api_client -->|"sends JSON requests"| node_http_server
node_http_server -->|"dispatches requests"| node_routes
node_routes -->|"routes requests"| node_handlers
node_handlers -->|"reads radar state"| node_service
node_service -->|"uses simulation engine"| node_engine
node_service -->|"provides configuration"| node_configuration
node_service -->|"provides detections"| node_detection
node_engine -->|"maintains state"| node_shared_state
node_engine -->|"runs simulation"| node_simulation_loop
node_simulation_loop -->|"moves targets"| node_targets
node_simulation_loop -.->|"creates targets"| node_generator
node_detection -->|"checks target range"| node_targets
node_control -->|"pauses or resumes"| node_engine
node_config_handler -.->|"reads configuration"| node_configuration
node_detection_handler -.->|"returns detections"| node_detection
node_targets_handler -.->|"returns targets"| node_targets

click node_app "https://github.com/digao791/radar-system/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/digao791/radar-system/blob/main/frontend/src/api/radarApi.ts"
click node_display "https://github.com/digao791/radar-system/blob/main/frontend/src/components/RadarDisplay.tsx"
click node_map "https://github.com/digao791/radar-system/blob/main/frontend/src/components/RadarMap.tsx"
click node_types "https://github.com/digao791/radar-system/blob/main/frontend/src/types/radar.ts"
click node_http_server "https://github.com/digao791/radar-system/blob/main/src/impl/radar_http.adb"
click node_routes "https://github.com/digao791/radar-system/blob/main/src/impl/radar-routes.adb"
click node_handlers "https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers.adb"
click node_config_handler "https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers-config.adb"
click node_detection_handler "https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers-detection.adb"
click node_targets_handler "https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers-targets.adb"
click node_service "https://github.com/digao791/radar-system/blob/main/src/impl/radar-service.adb"
click node_engine "https://github.com/digao791/radar-system/blob/main/src/impl/radar-engine.adb"
click node_shared_state "https://github.com/digao791/radar-system/blob/main/src/impl/radar-shared_state.adb"
click node_simulation_loop "https://github.com/digao791/radar-system/blob/main/src/impl/radar-simulation.adb"
click node_generator "https://github.com/digao791/radar-system/blob/main/src/impl/radar-target_generator.adb"
click node_targets "https://github.com/digao791/radar-system/blob/main/src/impl/radar-targets.adb"
click node_detection "https://github.com/digao791/radar-system/blob/main/src/impl/radar-detection.adb"
click node_configuration "https://github.com/digao791/radar-system/blob/main/src/impl/radar-configuration.adb"
click node_control "https://github.com/digao791/radar-system/blob/main/src/impl/radar-control.adb"

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_api_client,node_display,node_map,node_types,node_browser toneBlue
class node_http_server,node_routes,node_handlers,node_config_handler,node_detection_handler,node_targets_handler toneAmber
class node_service,node_engine,node_shared_state,node_simulation_loop,node_generator toneMint
class node_targets,node_detection,node_configuration,node_control toneRose
```

## Components

### Dashboard

- [Dashboard state](https://github.com/digao791/radar-system/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Radar API client](https://github.com/digao791/radar-system/blob/main/frontend/src/api/radarApi.ts): `frontend/src/api/radarApi.ts`
- [Radar display](https://github.com/digao791/radar-system/blob/main/frontend/src/components/RadarDisplay.tsx): `frontend/src/components/RadarDisplay.tsx`
- [Map overlay](https://github.com/digao791/radar-system/blob/main/frontend/src/components/RadarMap.tsx): `frontend/src/components/RadarMap.tsx`
- [Radar data types](https://github.com/digao791/radar-system/blob/main/frontend/src/types/radar.ts): `frontend/src/types/radar.ts`

### HTTP API

- [HTTP server](https://github.com/digao791/radar-system/blob/main/src/impl/radar_http.adb): `src/impl/radar_http.adb`
- [API routes](https://github.com/digao791/radar-system/blob/main/src/impl/radar-routes.adb): `src/impl/radar-routes.adb`
- [API handlers](https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers.adb): `src/impl/radar-handlers.adb`
- [Configuration handler](https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers-config.adb): `src/impl/radar-handlers-config.adb`
- [Detection handler](https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers-detection.adb): `src/impl/radar-handlers-detection.adb`
- [Targets handler](https://github.com/digao791/radar-system/blob/main/src/impl/radar-handlers-targets.adb): `src/impl/radar-handlers-targets.adb`

### Simulation

- [Radar service](https://github.com/digao791/radar-system/blob/main/src/impl/radar-service.adb): `src/impl/radar-service.adb`
- [Simulation engine](https://github.com/digao791/radar-system/blob/main/src/impl/radar-engine.adb): `src/impl/radar-engine.adb`
- [Shared state](https://github.com/digao791/radar-system/blob/main/src/impl/radar-shared_state.adb): `src/impl/radar-shared_state.adb`
- [Target simulation](https://github.com/digao791/radar-system/blob/main/src/impl/radar-simulation.adb): `src/impl/radar-simulation.adb`
- [Target generation](https://github.com/digao791/radar-system/blob/main/src/impl/radar-target_generator.adb): `src/impl/radar-target_generator.adb`

### Radar Logic

- [Target movement](https://github.com/digao791/radar-system/blob/main/src/impl/radar-targets.adb): `src/impl/radar-targets.adb`
- [Range detection](https://github.com/digao791/radar-system/blob/main/src/impl/radar-detection.adb): `src/impl/radar-detection.adb`
- [Radar configuration](https://github.com/digao791/radar-system/blob/main/src/impl/radar-configuration.adb): `src/impl/radar-configuration.adb`
- [Engine controls](https://github.com/digao791/radar-system/blob/main/src/impl/radar-control.adb): `src/impl/radar-control.adb`

### Other components

- **Web browser**

## Connections

- Web browser → Dashboard state: uses dashboard (evidence: `README.md`)
- Dashboard state → Radar API client: polls and controls (evidence: `frontend/src/App.tsx`)
- Dashboard state → Radar display: renders detections (evidence: `frontend/src/App.tsx`)
- Dashboard state → Radar data types: uses data types (evidence: `frontend/src/App.tsx`)
- Radar API client → HTTP server: sends JSON requests (evidence: `README.md`)
- HTTP server → API routes: dispatches requests (evidence: `README.md`)
- API routes → API handlers: routes requests (evidence: `README.md`)
- API handlers → Radar service: reads radar state (evidence: `README.md`)
- Radar service → Simulation engine: uses simulation engine (evidence: `README.md`)
- Radar service → Radar configuration: provides configuration (evidence: `README.md`)
- Radar service → Range detection: provides detections (evidence: `README.md`)
- Simulation engine → Shared state: maintains state (evidence: `README.md`)
- Simulation engine → Target simulation: runs simulation (evidence: `README.md`)
- Target simulation → Target movement: moves targets (evidence: `README.md`)
- Target simulation → Target generation: creates targets
- Range detection → Target movement: checks target range (evidence: `README.md`)
- Engine controls → Simulation engine: pauses or resumes (evidence: `README.md`)
- Configuration handler → Radar configuration: reads configuration
- Detection handler → Range detection: returns detections
- Targets handler → Target movement: returns targets
