# brandonransom/g711-radio architecture

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

- Interactive diagram: https://gitdiagram.com/brandonransom/g711-radio
- Repository: https://github.com/brandonransom/g711-radio

## Overview

G.711 Radio receives configured G.711 audio over UDP, broadcasts it to browser listeners over WebRTC, and can record clips and transcribe them with whisper.cpp. The server also exposes recording/transcript history, listener feedback, and optional private analytics. The graph includes documented capabilities whose implementation was not sampled; those links use README evidence. The excerpts do not show all runtime wiring, so uncertain implementation-level relationships are omitted.

Main entry points: [`main.go`](https://github.com/brandonransom/g711-radio/blob/master/main.go) (HTTP and stream server), [`web/index.html`](https://github.com/brandonransom/g711-radio/blob/master/web/index.html) (Listening interface), [`analytics.go`](https://github.com/brandonransom/g711-radio/blob/master/analytics.go) (Visitor analytics store), [`analytics_dashboard.go`](https://github.com/brandonransom/g711-radio/blob/master/analytics_dashboard.go) (Analytics dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_audio["Live audio"]
  node_udp{{"Configured UDP streams"}}
  node_server["HTTP and stream server<br/>[main.go]"]
  node_webrtc["WebRTC audio broadcast<br/>[main.go]"]
end

subgraph group_archive["Recordings and transcripts"]
  node_recorder["Audio recording<br/>[recorder.go]"]
  node_audioarchive[("Audio archive")]
  node_history["Recording index<br/>[recording_index.go]"]
  node_transcription["Whisper transcription pool<br/>[whisper.go]"]
  node_transcripthub["Transcript events and history<br/>[hub.go]"]
  node_feedback["Transcript feedback<br/>[feedback.go]"]
  node_prompttool["Prompt analysis<br/>[main.go]"]
end

subgraph group_analytics["Analytics"]
  node_analyticsstore[("Visitor analytics store<br/>[analytics.go]")]
  node_analyticsdashboard["Analytics dashboard"]
  node_geolocation["Network geolocation<br/>[analytics_geo.go]"]
  node_transcriptionanalytics["Transcription analytics"]
  node_radioarchive["Radio archive analytics<br/>[radio_archive.go]"]
end

subgraph group_web["Browser experience"]
  node_webapp["Listening interface<br/>[index.html]"]
  node_activity["Stream activity display<br/>[activity.js]"]
  node_nav["Navigation guard<br/>[nav-guard.js]"]
end

node_operator(("Stream operator"))
node_listener(("Browser listener"))

node_operator -->|"sends audio"| node_udp
node_udp -->|"receives packets"| node_server
node_server -->|"broadcasts audio"| node_webrtc
node_listener -->|"opens"| node_webapp
node_webapp -.->|"requests streams"| node_server
node_server -->|"records clips"| node_recorder
node_recorder -->|"writes clips"| node_audioarchive
node_server -->|"serves history"| node_history
node_history -->|"indexes WAV files"| node_audioarchive
node_server -->|"submits clips"| node_transcription
node_transcription -->|"publishes results"| node_transcripthub
node_transcripthub -->|"publishes corrections"| node_feedback
node_feedback -->|"analyzes CSV"| node_prompttool
node_webapp -->|"polls activity"| node_activity
node_webapp -.->|"guards navigation"| node_nav
node_server -->|"records events"| node_analyticsstore
node_analyticsdashboard -->|"shows statistics"| node_analyticsstore
node_analyticsstore -->|"labels networks"| node_geolocation
node_analyticsstore -->|"combines archive totals"| node_radioarchive
node_analyticsdashboard -->|"shows transcription data"| node_transcriptionanalytics

click node_server "https://github.com/brandonransom/g711-radio/blob/master/main.go"
click node_webrtc "https://github.com/brandonransom/g711-radio/blob/master/main.go"
click node_webapp "https://github.com/brandonransom/g711-radio/blob/master/web/index.html"
click node_activity "https://github.com/brandonransom/g711-radio/blob/master/web/activity.js"
click node_nav "https://github.com/brandonransom/g711-radio/blob/master/web/nav-guard.js"
click node_recorder "https://github.com/brandonransom/g711-radio/blob/master/recorder.go"
click node_history "https://github.com/brandonransom/g711-radio/blob/master/recording_index.go"
click node_transcription "https://github.com/brandonransom/g711-radio/blob/master/whisper.go"
click node_transcripthub "https://github.com/brandonransom/g711-radio/blob/master/hub.go"
click node_feedback "https://github.com/brandonransom/g711-radio/blob/master/feedback.go"
click node_prompttool "https://github.com/brandonransom/g711-radio/blob/master/cmd/mine-prompt/main.go"
click node_analyticsstore "https://github.com/brandonransom/g711-radio/blob/master/analytics.go"
click node_analyticsdashboard "https://github.com/brandonransom/g711-radio/blob/master/analytics_dashboard.go"
click node_geolocation "https://github.com/brandonransom/g711-radio/blob/master/analytics_geo.go"
click node_transcriptionanalytics "https://github.com/brandonransom/g711-radio/blob/master/transcription_analytics.go"
click node_radioarchive "https://github.com/brandonransom/g711-radio/blob/master/radio_archive.go"

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_udp,node_server,node_webrtc,node_listener toneBlue
class node_recorder,node_audioarchive,node_history,node_transcription,node_transcripthub,node_feedback,node_prompttool toneAmber
class node_analyticsstore,node_analyticsdashboard,node_geolocation,node_transcriptionanalytics,node_radioarchive toneMint
class node_webapp,node_activity,node_nav toneRose
class node_operator toneIndigo
```

## Components

### Live audio

- **Configured UDP streams**
- [HTTP and stream server](https://github.com/brandonransom/g711-radio/blob/master/main.go): `main.go`
- [WebRTC audio broadcast](https://github.com/brandonransom/g711-radio/blob/master/main.go): `main.go`

### Recordings and transcripts

- [Audio recording](https://github.com/brandonransom/g711-radio/blob/master/recorder.go): `recorder.go`
- **Audio archive**
- [Recording index](https://github.com/brandonransom/g711-radio/blob/master/recording_index.go): `recording_index.go`
- [Whisper transcription pool](https://github.com/brandonransom/g711-radio/blob/master/whisper.go): `whisper.go`
- [Transcript events and history](https://github.com/brandonransom/g711-radio/blob/master/hub.go): `hub.go`
- [Transcript feedback](https://github.com/brandonransom/g711-radio/blob/master/feedback.go): `feedback.go`
- [Prompt analysis](https://github.com/brandonransom/g711-radio/blob/master/cmd/mine-prompt/main.go): `cmd/mine-prompt/main.go`

### Analytics

- [Visitor analytics store](https://github.com/brandonransom/g711-radio/blob/master/analytics.go): `analytics.go`
- [Analytics dashboard](https://github.com/brandonransom/g711-radio/blob/master/analytics_dashboard.go): `analytics_dashboard.go`
- [Network geolocation](https://github.com/brandonransom/g711-radio/blob/master/analytics_geo.go): `analytics_geo.go`
- [Transcription analytics](https://github.com/brandonransom/g711-radio/blob/master/transcription_analytics.go): `transcription_analytics.go`
- [Radio archive analytics](https://github.com/brandonransom/g711-radio/blob/master/radio_archive.go): `radio_archive.go`

### Browser experience

- [Listening interface](https://github.com/brandonransom/g711-radio/blob/master/web/index.html): `web/index.html`
- [Stream activity display](https://github.com/brandonransom/g711-radio/blob/master/web/activity.js): `web/activity.js`
- [Navigation guard](https://github.com/brandonransom/g711-radio/blob/master/web/nav-guard.js): `web/nav-guard.js`

### Other components

- **Stream operator**
- **Browser listener**

## Connections

- Stream operator → Configured UDP streams: sends audio (evidence: `README.md`)
- Configured UDP streams → HTTP and stream server: receives packets (evidence: `README.md`)
- HTTP and stream server → WebRTC audio broadcast: broadcasts audio (evidence: `README.md`)
- Browser listener → Listening interface: opens (evidence: `README.md`)
- Listening interface → HTTP and stream server: requests streams
- HTTP and stream server → Audio recording: records clips (evidence: `README.md`)
- Audio recording → Audio archive: writes clips (evidence: `README.md`)
- HTTP and stream server → Recording index: serves history (evidence: `README.md`)
- Recording index → Audio archive: indexes WAV files (evidence: `README.md`)
- HTTP and stream server → Whisper transcription pool: submits clips (evidence: `README.md`)
- Whisper transcription pool → Transcript events and history: publishes results (evidence: `whisper.go`)
- Transcript events and history → Transcript feedback: publishes corrections (evidence: `feedback.go`)
- Transcript feedback → Prompt analysis: analyzes CSV (evidence: `cmd/mine-prompt/main.go`)
- Listening interface → Stream activity display: polls activity (evidence: `web/activity.js`)
- Listening interface → Navigation guard: guards navigation
- HTTP and stream server → Visitor analytics store: records events (evidence: `README.md`)
- Analytics dashboard → Visitor analytics store: shows statistics (evidence: `README.md`)
- Visitor analytics store → Network geolocation: labels networks (evidence: `README.md`)
- Visitor analytics store → Radio archive analytics: combines archive totals (evidence: `radio_archive.go`)
- Analytics dashboard → Transcription analytics: shows transcription data (evidence: `README.md`)
