# zeroleafx/anxinban-taigi-voice-assistant architecture

> Architecture diagram of the GitHub repository zeroleafx/anxinban-taigi-voice-assistant, 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/zeroleafx/anxinban-taigi-voice-assistant
- Repository: https://github.com/zeroleafx/anxinban-taigi-voice-assistant

## Overview

AnXinBan is a Flutter Taiwanese-language voice assistant, with family-care features alongside its main voice workflow. A user records a command; the app stores the clip, transcribes it on-device or through the optional web service, interprets the text, and performs a phone action or presents a result. Recording playback, spoken Taiwanese replies, model downloads, emergency assistance, and family pairing/cloud features are distinct supporting capabilities. The README documents the main flow and platform behavior; family-cloud wiring is not shown in the sampled source, so its relationships are left out.

Main entry points: [`lib/recording_controller.dart`](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/recording_controller.dart) (Recording control), [`lib/phone_actions.dart`](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/phone_actions.dart) (Phone actions), [`lib/home_page.dart`](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/home_page.dart) (Home screen), [`lib/speech_model.dart`](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/speech_model.dart) (Speech model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and recording"]
  node_app["App startup<br/>[main.dart]"]
  node_home["Home screen<br/>[home_page.dart]"]
  node_recording["Recording control"]
  node_storage[("Recording storage")]
end

subgraph group_speech["Speech and replies"]
  node_speech_model["Speech model<br/>[speech_model.dart]"]
  node_model_download["Model download"]
  node_web_transcription["Web transcription"]
  node_taigi_voice["Taiwanese speech<br/>[taigi_voice.dart]"]
  node_taigi_phrases["Spoken phrases<br/>[taigi_phrases.dart]"]
end

subgraph group_commands["Commands and assistance"]
  node_voice_command["Command parser<br/>[voice_command.dart]"]
  node_phone_actions["Phone actions<br/>[phone_actions.dart]"]
  node_contact_matcher["Contact matching"]
  node_emergency[("Emergency assistance")]
  node_torch["Flashlight control<br/>[torch_channel.dart]"]
end

subgraph group_family["Family features"]
  node_family_dashboard["Family dashboard"]
  node_pairing["Elder pairing"]
  node_family_cloud["Family cloud<br/>[family_cloud.dart]"]
end

subgraph group_services["Recognition services"]
  node_space["Transcription service<br/>[app.py]"]
end

node_user(("User"))
node_supabase[("Supabase")]

node_user -->|"uses"| node_home
node_home -->|"starts/stops"| node_recording
node_recording -->|"saves clip"| node_storage
node_storage -->|"plays latest"| node_home
node_recording -->|"transcribes mobile"| node_speech_model
node_speech_model -->|"downloads model"| node_model_download
node_recording -->|"uploads on request"| node_web_transcription
node_web_transcription -->|"sends audio"| node_space
node_space -->|"returns transcript"| node_web_transcription
node_speech_model -->|"provides transcript"| node_voice_command
node_voice_command -->|"dispatches action"| node_phone_actions
node_phone_actions -->|"matches contact"| node_contact_matcher
node_phone_actions -->|"uses emergency contact"| node_emergency
node_phone_actions -->|"controls flashlight"| node_torch
node_home -->|"reads result cards"| node_taigi_voice
node_taigi_voice -->|"reads phrases"| node_taigi_phrases
node_user -.->|"manages family"| node_family_dashboard
node_family_dashboard -.->|"pairs elder"| node_pairing
node_family_cloud -.->|"syncs family data"| node_supabase

click node_app "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/main.dart"
click node_home "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/home_page.dart"
click node_recording "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/recording_controller.dart"
click node_storage "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/recording_storage.dart"
click node_speech_model "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/speech_model.dart"
click node_model_download "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/model_download.dart"
click node_web_transcription "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/web_transcription.dart"
click node_space "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/space/app.py"
click node_voice_command "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/voice_command.dart"
click node_phone_actions "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/phone_actions.dart"
click node_contact_matcher "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/contact_matcher.dart"
click node_emergency "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/emergency_store.dart"
click node_torch "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/torch_channel.dart"
click node_taigi_voice "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/taigi_voice.dart"
click node_taigi_phrases "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/taigi_phrases.dart"
click node_family_dashboard "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/family_dashboard.dart"
click node_pairing "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/elder_pairing_page.dart"
click node_family_cloud "https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/family_cloud.dart"

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_home,node_recording,node_storage,node_user toneBlue
class node_speech_model,node_model_download,node_web_transcription,node_taigi_voice,node_taigi_phrases,node_supabase toneAmber
class node_voice_command,node_phone_actions,node_contact_matcher,node_emergency,node_torch toneMint
class node_family_dashboard,node_pairing,node_family_cloud toneRose
class node_space toneIndigo
```

## Components

### App and recording

- [App startup](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/main.dart): `lib/main.dart`
- [Home screen](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/home_page.dart): `lib/home_page.dart`
- [Recording control](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/recording_controller.dart): `lib/recording_controller.dart`
- [Recording storage](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/recording_storage.dart): `lib/recording_storage.dart`

### Speech and replies

- [Speech model](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/speech_model.dart): `lib/speech_model.dart`
- [Model download](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/model_download.dart): `lib/model_download.dart`
- [Web transcription](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/web_transcription.dart): `lib/web_transcription.dart`
- [Taiwanese speech](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/taigi_voice.dart): `lib/taigi_voice.dart`
- [Spoken phrases](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/taigi_phrases.dart): `lib/taigi_phrases.dart`

### Commands and assistance

- [Command parser](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/voice_command.dart): `lib/voice_command.dart`
- [Phone actions](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/phone_actions.dart): `lib/phone_actions.dart`
- [Contact matching](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/contact_matcher.dart): `lib/contact_matcher.dart`
- [Emergency assistance](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/emergency_store.dart): `lib/emergency_store.dart`
- [Flashlight control](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/torch_channel.dart): `lib/torch_channel.dart`

### Family features

- [Family dashboard](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/family_dashboard.dart): `lib/family_dashboard.dart`
- [Elder pairing](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/elder_pairing_page.dart): `lib/elder_pairing_page.dart`
- [Family cloud](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/lib/family_cloud.dart): `lib/family_cloud.dart`

### Recognition services

- [Transcription service](https://github.com/zeroleafx/anxinban-taigi-voice-assistant/blob/main/space/app.py): `space/app.py`

### Other components

- **User**
- **Supabase**

## Connections

- User → Home screen: uses (evidence: `README.md`)
- Home screen → Recording control: starts/stops (evidence: `README.md`)
- Recording control → Recording storage: saves clip (evidence: `README.md`)
- Recording storage → Home screen: plays latest (evidence: `README.md`)
- Recording control → Speech model: transcribes mobile (evidence: `README.md`)
- Speech model → Model download: downloads model (evidence: `README.md`)
- Recording control → Web transcription: uploads on request (evidence: `README.md`)
- Web transcription → Transcription service: sends audio (evidence: `README.md`)
- Transcription service → Web transcription: returns transcript (evidence: `README.md`)
- Speech model → Command parser: provides transcript (evidence: `README.md`)
- Command parser → Phone actions: dispatches action (evidence: `README.md`)
- Phone actions → Contact matching: matches contact (evidence: `README.md`)
- Phone actions → Emergency assistance: uses emergency contact (evidence: `README.md`)
- Phone actions → Flashlight control: controls flashlight (evidence: `README.md`)
- Home screen → Taiwanese speech: reads result cards (evidence: `README.md`)
- Taiwanese speech → Spoken phrases: reads phrases (evidence: `README.md`)
- User → Family dashboard: manages family
- Family dashboard → Elder pairing: pairs elder
- Family cloud → Supabase: syncs family data
