# nathantodd-devel/radio-software architecture

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

- Interactive diagram: https://gitdiagram.com/nathantodd-devel/radio-software
- Repository: https://github.com/nathantodd-devel/radio-software

## Overview

DMPS is a wideband police-radio scanner with desktop, browser, and Android front ends. The main workflow is selecting channel systems, acquiring SDR samples, demodulating analog FM or P25 calls, and presenting live activity with audio and recordings. The graph also preserves documented database/import, receiver, and web-serving capabilities. Some implementation paths were not excerpted; those connections are omitted or marked unverified rather than inferred from names alone.

Main entry points: [`crates/scanner/src/engine.rs`](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/engine.rs) (Receive engine), [`crates/scanner-ui/src/main.rs`](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-ui/src/main.rs) (Desktop UI), [`mobile/src/ui.rs`](https://github.com/nathantodd-devel/radio-software/blob/main/mobile/src/ui.rs) (Android UI), [`crates/scanner/src/session.rs`](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/session.rs) (Scan session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_radio["Radio processing"]
  node_receiver["Receiver interface<br/>[lib.rs]"]
  node_airspy["Airspy driver<br/>[lib.rs]"]
  node_rtlsdr["RTL-SDR driver<br/>[lib.rs]"]
  node_dsp["Signal processing"]
end

subgraph group_scanner["Scan management"]
  node_plan["Scan planning<br/>[plan.rs]"]
  node_engine["Receive engine<br/>[engine.rs]"]
  node_session["Scan session<br/>[session.rs]"]
  node_database[("Channel database<br/>[db.rs]")]
  node_imports["Channel imports<br/>[radioreference.rs]"]
  node_recordings["Call recordings<br/>[wav.rs]"]
end

subgraph group_desktop["Desktop client"]
  node_desktop["Desktop UI<br/>[main.rs]"]
  node_editor["System editor<br/>[editor.rs]"]
  node_theme["Theme support<br/>[theme.rs]"]
end

subgraph group_web["Web client and server"]
  node_webserver["Web server<br/>[main.rs]"]
  node_hub["Shared scan hub<br/>[hub.rs]"]
  node_http["HTTP and sockets<br/>[http.rs]"]
  node_browser["Browser UI<br/>[ui.rs]"]
  node_browsernet["Browser networking<br/>[net.rs]"]
  node_browseraudio["Browser audio<br/>[audio.rs]"]
end

subgraph group_mobile["Android client"]
  node_android["Android UI<br/>[ui.rs]"]
  node_usb["Android USB radios<br/>[usb.rs]"]
  node_playback["Background playback"]
end

node_listener(("Scanner user"))

node_listener -->|"controls scanner"| node_desktop
node_listener -->|"controls scanner"| node_browser
node_listener -->|"controls scanner"| node_android
node_airspy -->|"implements"| node_receiver
node_rtlsdr -->|"implements"| node_receiver
node_engine -->|"uses plan"| node_plan
node_engine -->|"reads and writes"| node_recordings
node_session -->|"runs scan"| node_engine
node_engine -->|"demodulates calls"| node_dsp
node_receiver -.->|"supplies samples"| node_engine
node_database -.->|"provides channels"| node_plan
node_imports -.->|"imports channels"| node_database
node_desktop -.->|"controls scan"| node_session
node_desktop -->|"opens editor"| node_editor
node_desktop -->|"uses themes"| node_theme
node_webserver -->|"starts hub"| node_hub
node_webserver -->|"serves requests"| node_http
node_http -->|"dispatches requests"| node_hub
node_hub -.->|"runs scan"| node_session
node_browser -->|"sends controls"| node_browsernet
node_browsernet -.->|"exchanges messages"| node_http
node_browsernet -->|"delivers audio"| node_browseraudio
node_android -->|"manages radios"| node_usb
node_android -.->|"controls scan"| node_session
node_playback -->|"keeps process foreground"| node_android

click node_receiver "https://github.com/nathantodd-devel/radio-software/blob/main/crates/drivers/receiver/src/lib.rs"
click node_airspy "https://github.com/nathantodd-devel/radio-software/blob/main/crates/drivers/airspy/src/lib.rs"
click node_rtlsdr "https://github.com/nathantodd-devel/radio-software/blob/main/crates/drivers/rtlsdr/src/lib.rs"
click node_dsp "https://github.com/nathantodd-devel/radio-software/tree/main/crates/radiocore/src"
click node_plan "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/plan.rs"
click node_engine "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/engine.rs"
click node_session "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/session.rs"
click node_database "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/db.rs"
click node_imports "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/radioreference.rs"
click node_recordings "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/wav.rs"
click node_desktop "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-ui/src/main.rs"
click node_editor "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-ui/src/editor.rs"
click node_theme "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-ui/src/theme.rs"
click node_webserver "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-web/src/main.rs"
click node_hub "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-web/src/hub.rs"
click node_http "https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-web/src/http.rs"
click node_browser "https://github.com/nathantodd-devel/radio-software/blob/main/web/src/ui.rs"
click node_browsernet "https://github.com/nathantodd-devel/radio-software/blob/main/web/src/net.rs"
click node_browseraudio "https://github.com/nathantodd-devel/radio-software/blob/main/web/src/audio.rs"
click node_android "https://github.com/nathantodd-devel/radio-software/blob/main/mobile/src/ui.rs"
click node_usb "https://github.com/nathantodd-devel/radio-software/blob/main/mobile/src/usb.rs"
click node_playback "https://github.com/nathantodd-devel/radio-software/blob/main/mobile/android/gradle/app/src/main/java/com/fairhouse/dmps/PlaybackService.java"

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_receiver,node_airspy,node_rtlsdr,node_dsp,node_listener toneBlue
class node_plan,node_engine,node_session,node_database,node_imports,node_recordings toneAmber
class node_desktop,node_editor,node_theme toneMint
class node_webserver,node_hub,node_http,node_browser,node_browsernet,node_browseraudio toneRose
class node_android,node_usb,node_playback toneIndigo
```

## Components

### Radio processing

- [Receiver interface](https://github.com/nathantodd-devel/radio-software/blob/main/crates/drivers/receiver/src/lib.rs): `crates/drivers/receiver/src/lib.rs`
- [Airspy driver](https://github.com/nathantodd-devel/radio-software/blob/main/crates/drivers/airspy/src/lib.rs): `crates/drivers/airspy/src/lib.rs`
- [RTL-SDR driver](https://github.com/nathantodd-devel/radio-software/blob/main/crates/drivers/rtlsdr/src/lib.rs): `crates/drivers/rtlsdr/src/lib.rs`
- [Signal processing](https://github.com/nathantodd-devel/radio-software/tree/main/crates/radiocore/src): `crates/radiocore/src`

### Scan management

- [Scan planning](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/plan.rs): `crates/scanner/src/plan.rs`
- [Receive engine](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/engine.rs): `crates/scanner/src/engine.rs`
- [Scan session](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/session.rs): `crates/scanner/src/session.rs`
- [Channel database](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/db.rs): `crates/scanner/src/db.rs`
- [Channel imports](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/radioreference.rs): `crates/scanner/src/radioreference.rs`
- [Call recordings](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner/src/wav.rs): `crates/scanner/src/wav.rs`

### Desktop client

- [Desktop UI](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-ui/src/main.rs): `crates/scanner-ui/src/main.rs`
- [System editor](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-ui/src/editor.rs): `crates/scanner-ui/src/editor.rs`
- [Theme support](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-ui/src/theme.rs): `crates/scanner-ui/src/theme.rs`

### Web client and server

- [Web server](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-web/src/main.rs): `crates/scanner-web/src/main.rs`
- [Shared scan hub](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-web/src/hub.rs): `crates/scanner-web/src/hub.rs`
- [HTTP and sockets](https://github.com/nathantodd-devel/radio-software/blob/main/crates/scanner-web/src/http.rs): `crates/scanner-web/src/http.rs`
- [Browser UI](https://github.com/nathantodd-devel/radio-software/blob/main/web/src/ui.rs): `web/src/ui.rs`
- [Browser networking](https://github.com/nathantodd-devel/radio-software/blob/main/web/src/net.rs): `web/src/net.rs`
- [Browser audio](https://github.com/nathantodd-devel/radio-software/blob/main/web/src/audio.rs): `web/src/audio.rs`

### Android client

- [Android UI](https://github.com/nathantodd-devel/radio-software/blob/main/mobile/src/ui.rs): `mobile/src/ui.rs`
- [Android USB radios](https://github.com/nathantodd-devel/radio-software/blob/main/mobile/src/usb.rs): `mobile/src/usb.rs`
- [Background playback](https://github.com/nathantodd-devel/radio-software/blob/main/mobile/android/gradle/app/src/main/java/com/fairhouse/dmps/PlaybackService.java): `mobile/android/gradle/app/src/main/java/com/fairhouse/dmps/PlaybackService.java`

### Other components

- **Scanner user**

## Connections

- Scanner user → Desktop UI: controls scanner (evidence: `README.md`)
- Scanner user → Browser UI: controls scanner (evidence: `README.md`)
- Scanner user → Android UI: controls scanner (evidence: `README.md`)
- Airspy driver → Receiver interface: implements (evidence: `crates/drivers/airspy/src/lib.rs`)
- RTL-SDR driver → Receiver interface: implements (evidence: `crates/drivers/rtlsdr/src/lib.rs`)
- Receive engine → Scan planning: uses plan (evidence: `crates/scanner/src/engine.rs`)
- Receive engine → Call recordings: reads and writes (evidence: `crates/scanner/src/engine.rs`)
- Scan session → Receive engine: runs scan (evidence: `crates/scanner/src/session.rs`)
- Receive engine → Signal processing: demodulates calls (evidence: `README.md`)
- Receiver interface → Receive engine: supplies samples
- Channel database → Scan planning: provides channels
- Channel imports → Channel database: imports channels
- Desktop UI → Scan session: controls scan
- Desktop UI → System editor: opens editor (evidence: `crates/scanner-ui/src/main.rs`)
- Desktop UI → Theme support: uses themes (evidence: `crates/scanner-ui/src/main.rs`)
- Web server → Shared scan hub: starts hub (evidence: `crates/scanner-web/src/main.rs`)
- Web server → HTTP and sockets: serves requests (evidence: `crates/scanner-web/src/main.rs`)
- HTTP and sockets → Shared scan hub: dispatches requests (evidence: `crates/scanner-web/src/http.rs`)
- Shared scan hub → Scan session: runs scan
- Browser UI → Browser networking: sends controls (evidence: `web/src/ui.rs`)
- Browser networking → HTTP and sockets: exchanges messages
- Browser networking → Browser audio: delivers audio (evidence: `web/src/net.rs`)
- Android UI → Android USB radios: manages radios (evidence: `mobile/src/lib.rs`)
- Android UI → Scan session: controls scan
- Background playback → Android UI: keeps process foreground (evidence: `mobile/android/gradle/app/src/main/java/com/fairhouse/dmps/PlaybackService.java`)
