# tech4seven/backtalk-mobile architecture

> Architecture diagram of the GitHub repository tech4seven/backtalk-mobile, 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/tech4seven/backtalk-mobile
- Repository: https://github.com/tech4seven/backtalk-mobile

## Overview

Backtalk Mobile is a local browser companion for voice and typed conversations with a read-only Codex CLI session. The main workflow runs from the mobile interface through the local HTTP service: audio is transcribed, the turn is sent to Codex, and the reply is returned as text and streamed speech; typed messages use the same conversation with optional speech. The excerpts show browser requests, audio capture and playback, configuration, transcription, and Codex invocation. Speech synthesis and some server routing details are documented but not visible in the sampled code.

Main entry points: [`static/app.js`](https://github.com/tech4seven/backtalk-mobile/blob/main/static/app.js) (Conversation interface), [`server.py`](https://github.com/tech4seven/backtalk-mobile/blob/main/server.py) (Turn handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Mobile browser"]
  node_interface["Conversation interface<br/>[app.js]"]
  node_capture["Audio capture<br/>[app.js]"]
  node_playback["Audio playback<br/>[app.js]"]
end

subgraph group_service["Local service"]
  node_http["HTTP API<br/>[server.py]"]
  node_settings["Mobile settings<br/>[server.py]"]
  node_turn["Turn handling<br/>[server.py]"]
end

subgraph group_conversation["Conversation and speech"]
  node_transcription["Speech transcription<br/>[server.py]"]
  node_backtalk["Backtalk speech stack"]
  node_codex["Codex conversation"]
  node_session["Session state<br/>[server.py]"]
  node_synthesis["Speech synthesis"]
end

node_user(("Mobile user"))

node_user -->|"uses"| node_interface
node_interface -->|"starts recording"| node_capture
node_capture -->|"submits audio"| node_interface
node_interface -->|"sends turns"| node_http
node_http -.->|"serves config"| node_settings
node_http -.->|"handles requests"| node_turn
node_turn -->|"transcribes audio"| node_transcription
node_transcription -->|"uses speech models"| node_backtalk
node_turn -->|"runs read-only turns"| node_codex
node_turn -->|"loads and saves"| node_session
node_turn -->|"synthesizes replies"| node_synthesis
node_http -->|"streams replies"| node_interface
node_interface -->|"plays audio"| node_playback
node_playback -->|"outputs speech"| node_user

click node_interface "https://github.com/tech4seven/backtalk-mobile/blob/main/static/app.js"
click node_capture "https://github.com/tech4seven/backtalk-mobile/blob/main/static/app.js"
click node_playback "https://github.com/tech4seven/backtalk-mobile/blob/main/static/app.js"
click node_http "https://github.com/tech4seven/backtalk-mobile/blob/main/server.py"
click node_settings "https://github.com/tech4seven/backtalk-mobile/blob/main/server.py"
click node_turn "https://github.com/tech4seven/backtalk-mobile/blob/main/server.py"
click node_transcription "https://github.com/tech4seven/backtalk-mobile/blob/main/server.py"
click node_session "https://github.com/tech4seven/backtalk-mobile/blob/main/server.py"

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_interface,node_capture,node_playback,node_user toneBlue
class node_http,node_settings,node_turn toneAmber
class node_transcription,node_backtalk,node_codex,node_session,node_synthesis toneMint
```

## Components

### Mobile browser

- [Conversation interface](https://github.com/tech4seven/backtalk-mobile/blob/main/static/app.js): `static/app.js`
- [Audio capture](https://github.com/tech4seven/backtalk-mobile/blob/main/static/app.js): `static/app.js`
- [Audio playback](https://github.com/tech4seven/backtalk-mobile/blob/main/static/app.js): `static/app.js`

### Local service

- [HTTP API](https://github.com/tech4seven/backtalk-mobile/blob/main/server.py): `server.py`
- [Mobile settings](https://github.com/tech4seven/backtalk-mobile/blob/main/server.py): `server.py`
- [Turn handling](https://github.com/tech4seven/backtalk-mobile/blob/main/server.py): `server.py`

### Conversation and speech

- [Speech transcription](https://github.com/tech4seven/backtalk-mobile/blob/main/server.py): `server.py`
- **Backtalk speech stack**
- **Codex conversation**
- [Session state](https://github.com/tech4seven/backtalk-mobile/blob/main/server.py): `server.py`
- **Speech synthesis**

### Other components

- **Mobile user**

## Connections

- Mobile user → Conversation interface: uses (evidence: `README.md`)
- Conversation interface → Audio capture: starts recording (evidence: `static/app.js`)
- Audio capture → Conversation interface: submits audio (evidence: `static/app.js`)
- Conversation interface → HTTP API: sends turns (evidence: `static/app.js`)
- HTTP API → Mobile settings: serves config (evidence: `server.py`)
- HTTP API → Turn handling: handles requests (evidence: `server.py`)
- Turn handling → Speech transcription: transcribes audio (evidence: `README.md`)
- Speech transcription → Backtalk speech stack: uses speech models (evidence: `README.md`)
- Turn handling → Codex conversation: runs read-only turns (evidence: `server.py`)
- Turn handling → Session state: loads and saves (evidence: `server.py`)
- Turn handling → Speech synthesis: synthesizes replies (evidence: `README.md`)
- HTTP API → Conversation interface: streams replies (evidence: `static/app.js`)
- Conversation interface → Audio playback: plays audio (evidence: `static/app.js`)
- Audio playback → Mobile user: outputs speech (evidence: `README.md`)
