# riothitori/testvoice architecture

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

- Interactive diagram: https://gitdiagram.com/riothitori/testvoice
- Repository: https://github.com/riothitori/testvoice

## Overview

testvoice is a Tauri desktop voice OCR/TTS application. Users enter through the React interface, authenticate or choose a feature, then use OCR, speech, or movie-related views; the native Rust side provides capture/overlay, recognition, translation, authentication, and speech services. The excerpts show the UI’s feature routing and several native-module calls, but not the full command registration or all feature-to-command mappings, so those links are omitted rather than inferred.

Main entry points: [`src-tauri/src/main.rs`](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/main.rs) (Tauri runtime), [`src/App.tsx`](https://github.com/riothitori/testvoice/blob/main/src/App.tsx) (App shell), [`src-tauri/src/translator.rs`](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/translator.rs) (Translation), [`src-tauri/src/auth.rs`](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/auth.rs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["React interface"]
  node_app["App shell<br/>[App.tsx]"]
  node_login["Login view<br/>[LoginView.tsx]"]
  node_settings["Sidebar settings"]
  node_tutorial["Interactive tutorial"]
  node_ocr_ui["OCR tab<br/>[OcrTab.tsx]"]
  node_speak_ui["Speak tab<br/>[SpeakTab.tsx]"]
  node_movie_ui["Movie tab<br/>[MovieTab.tsx]"]
end

subgraph group_capture["Capture and OCR"]
  node_vision["Screen vision<br/>[eye.rs]"]
  node_choice["Choice scanning<br/>[choice_scan.rs]"]
  node_ocr_engine["Snipping OCR<br/>[snipping_ocr.rs]"]
  node_crop["Auto crop<br/>[auto_crop.rs]"]
  node_novel["Novel text flow<br/>[novel.rs]"]
end

subgraph group_language["Language and speech"]
  node_hooklearn["Phonetic learning<br/>[hooklearn.rs]"]
  node_nlp["Text normalization<br/>[nlp.rs]"]
  node_translator["Translation<br/>[translator.rs]"]
  node_speak["Speech orchestration<br/>[speak.rs]"]
  node_tts["Text to speech<br/>[tts.rs]"]
end

subgraph group_desktop["Desktop services"]
  node_native_entry["Tauri runtime<br/>[main.rs]"]
  node_overlay["Overlay windows<br/>[overlay.rs]"]
  node_auth["Authentication<br/>[auth.rs]"]
end

node_user(("User"))
node_auth_service{{"Authentication API"}}
node_translation_service{{"Translation providers"}}

node_user -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_settings
node_app -->|"routes to"| node_ocr_ui
node_app -->|"routes to"| node_speak_ui
node_app -->|"routes to"| node_movie_ui
node_native_entry -->|"sets up"| node_overlay
node_native_entry -->|"initializes"| node_tts
node_native_entry -->|"initializes"| node_nlp
node_native_entry -->|"starts worker"| node_translator
node_native_entry -->|"starts watchdog"| node_auth
node_native_entry -->|"loads phonetics"| node_hooklearn
node_novel -->|"recognizes image"| node_ocr_engine
node_auth -->|"requests auth"| node_auth_service
node_translator -->|"requests translation"| node_translation_service

click node_app "https://github.com/riothitori/testvoice/blob/main/src/App.tsx"
click node_login "https://github.com/riothitori/testvoice/blob/main/src/components/LoginView.tsx"
click node_settings "https://github.com/riothitori/testvoice/blob/main/src/components/SidebarSettings.tsx"
click node_tutorial "https://github.com/riothitori/testvoice/blob/main/src/components/InteractiveTutorial.tsx"
click node_ocr_ui "https://github.com/riothitori/testvoice/blob/main/src/components/tabs/OcrTab.tsx"
click node_speak_ui "https://github.com/riothitori/testvoice/blob/main/src/components/tabs/SpeakTab.tsx"
click node_movie_ui "https://github.com/riothitori/testvoice/blob/main/src/components/tabs/MovieTab.tsx"
click node_native_entry "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/main.rs"
click node_vision "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/eye.rs"
click node_choice "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/choice_scan.rs"
click node_ocr_engine "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/snipping_ocr.rs"
click node_crop "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/auto_crop.rs"
click node_novel "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/novel.rs"
click node_overlay "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/overlay.rs"
click node_auth "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/auth.rs"
click node_hooklearn "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/hooklearn.rs"
click node_nlp "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/nlp.rs"
click node_translator "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/translator.rs"
click node_speak "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/speak.rs"
click node_tts "https://github.com/riothitori/testvoice/blob/main/src-tauri/src/tts.rs"

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_login,node_settings,node_tutorial,node_ocr_ui,node_speak_ui,node_movie_ui,node_user toneBlue
class node_vision,node_choice,node_ocr_engine,node_crop,node_novel toneAmber
class node_hooklearn,node_nlp,node_translator,node_speak,node_tts,node_auth_service toneMint
class node_native_entry,node_overlay,node_auth toneRose
class node_translation_service toneIndigo
```

## Components

### React interface

- [App shell](https://github.com/riothitori/testvoice/blob/main/src/App.tsx): `src/App.tsx`
- [Login view](https://github.com/riothitori/testvoice/blob/main/src/components/LoginView.tsx): `src/components/LoginView.tsx`
- [Sidebar settings](https://github.com/riothitori/testvoice/blob/main/src/components/SidebarSettings.tsx): `src/components/SidebarSettings.tsx`
- [Interactive tutorial](https://github.com/riothitori/testvoice/blob/main/src/components/InteractiveTutorial.tsx): `src/components/InteractiveTutorial.tsx`
- [OCR tab](https://github.com/riothitori/testvoice/blob/main/src/components/tabs/OcrTab.tsx): `src/components/tabs/OcrTab.tsx`
- [Speak tab](https://github.com/riothitori/testvoice/blob/main/src/components/tabs/SpeakTab.tsx): `src/components/tabs/SpeakTab.tsx`
- [Movie tab](https://github.com/riothitori/testvoice/blob/main/src/components/tabs/MovieTab.tsx): `src/components/tabs/MovieTab.tsx`

### Capture and OCR

- [Screen vision](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/eye.rs): `src-tauri/src/eye.rs`
- [Choice scanning](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/choice_scan.rs): `src-tauri/src/choice_scan.rs`
- [Snipping OCR](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/snipping_ocr.rs): `src-tauri/src/snipping_ocr.rs`
- [Auto crop](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/auto_crop.rs): `src-tauri/src/auto_crop.rs`
- [Novel text flow](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/novel.rs): `src-tauri/src/novel.rs`

### Language and speech

- [Phonetic learning](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/hooklearn.rs): `src-tauri/src/hooklearn.rs`
- [Text normalization](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/nlp.rs): `src-tauri/src/nlp.rs`
- [Translation](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/translator.rs): `src-tauri/src/translator.rs`
- [Speech orchestration](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/speak.rs): `src-tauri/src/speak.rs`
- [Text to speech](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/tts.rs): `src-tauri/src/tts.rs`

### Desktop services

- [Tauri runtime](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/main.rs): `src-tauri/src/main.rs`
- [Overlay windows](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/overlay.rs): `src-tauri/src/overlay.rs`
- [Authentication](https://github.com/riothitori/testvoice/blob/main/src-tauri/src/auth.rs): `src-tauri/src/auth.rs`

### Other components

- **User**
- **Authentication API**
- **Translation providers**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Login view: renders (evidence: `src/App.tsx`)
- App shell → Sidebar settings: renders (evidence: `src/App.tsx`)
- App shell → OCR tab: routes to (evidence: `src/App.tsx`)
- App shell → Speak tab: routes to (evidence: `src/App.tsx`)
- App shell → Movie tab: routes to (evidence: `src/App.tsx`)
- Tauri runtime → Overlay windows: sets up (evidence: `src-tauri/src/main.rs`)
- Tauri runtime → Text to speech: initializes (evidence: `src-tauri/src/main.rs`)
- Tauri runtime → Text normalization: initializes (evidence: `src-tauri/src/main.rs`)
- Tauri runtime → Translation: starts worker (evidence: `src-tauri/src/main.rs`)
- Tauri runtime → Authentication: starts watchdog (evidence: `src-tauri/src/main.rs`)
- Tauri runtime → Phonetic learning: loads phonetics (evidence: `src-tauri/src/main.rs`)
- Novel text flow → Snipping OCR: recognizes image (evidence: `src-tauri/src/novel.rs`)
- Authentication → Authentication API: requests auth (evidence: `src-tauri/src/auth.rs`)
- Translation → Translation providers: requests translation (evidence: `src-tauri/src/translator.rs`)
