# karansinghgit/speaktype architecture

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

- Interactive diagram: https://gitdiagram.com/karansinghgit/speaktype
- Repository: https://github.com/karansinghgit/speaktype

## Overview

SpeakType is an offline-first desktop dictation app for macOS, Windows, and Linux. Users choose or download an on-device speech model, invoke a shortcut, record speech, transcribe and clean up the text, then paste it into the focused app; local history supports replay and usage statistics. The repository contains a Swift macOS app and a React/Rust desktop app. The workflow is documented in the README, but desktop runtime internals were not sampled; those connections are left unverified rather than inferred.

Main entry points: [`speaktype/Services/Transcription/TranscriptionManager.swift`](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/Transcription/TranscriptionManager.swift) (Transcription router), [`speaktype/Views/Overlays/MiniRecorderView.swift`](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Overlays/MiniRecorderView.swift) (Recorder pill), [`speaktype/Services/ModelDownloadService.swift`](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/ModelDownloadService.swift) (Model downloads), [`speaktype/Controllers/MiniRecorderWindowController.swift`](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Controllers/MiniRecorderWindowController.swift) (Recorder window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Dictation capture"]
  node_recorder["Recorder pill"]
  node_window["Recorder window"]
  node_audio["Audio recording"]
end

subgraph group_speech["Speech and models"]
  node_transcription["Transcription router"]
  node_whisper["Whisper engine"]
  node_parakeet["Parakeet engine"]
  node_engine_contract["Engine contract"]
  node_model_catalog["Model catalog<br/>[AIModel.swift]"]
  node_model_download["Model downloads"]
end

subgraph group_persistence["Local data"]
  node_model_storage[("Model storage<br/>[ModelStorage.swift]")]
  node_dictionary[("Dictionary cleanup")]
  node_history[("Dictation history")]
end

subgraph group_experience["App experience"]
  node_desktop_ui["Desktop screens"]
  node_routes["Screen routes<br/>[routes.ts]"]
  node_dashboard["Dashboard and stats"]
  node_history_screen["History screen<br/>[HistoryView.swift]"]
  node_dictionary_screen["Dictionary screen"]
  node_models_screen["Model settings<br/>[AIModelsView.swift]"]
  node_onboarding["Onboarding"]
  node_update_service["Version updates"]
  node_update_screen["Update dialog<br/>[UpdateSheet.swift]"]
end

subgraph group_platform["Desktop integration"]
  node_shortcut["Shortcut capture<br/>[mod.rs]"]
  node_clipboard["Clipboard and paste"]
end

node_user(("User"))
node_target_app(("Focused app"))

node_user -.->|"holds shortcut"| node_shortcut
node_shortcut -.->|"starts dictation"| node_recorder
node_window -->|"hosts view"| node_recorder
node_window -->|"signals recording"| node_audio
node_recorder -->|"records audio"| node_audio
node_recorder -->|"requests transcription"| node_transcription
node_transcription -->|"routes by model"| node_whisper
node_transcription -->|"routes by model"| node_parakeet
node_transcription -->|"cleans transcript"| node_dictionary
node_whisper -->|"conforms to"| node_engine_contract
node_parakeet -->|"conforms to"| node_engine_contract
node_model_catalog -->|"selects engine"| node_transcription
node_model_download -->|"stores models"| node_model_storage
node_model_download -->|"uses catalog"| node_model_catalog
node_model_download -->|"loads selected model"| node_transcription
node_whisper -->|"loads local models"| node_model_storage
node_recorder -->|"records dictations"| node_history
node_window -->|"pastes result"| node_clipboard
node_clipboard -.->|"inserts text"| node_target_app
node_user -.->|"uses app screens"| node_desktop_ui
node_desktop_ui -->|"uses navigation"| node_routes
node_user -.->|"views activity"| node_dashboard
node_user -.->|"reviews dictations"| node_history_screen
node_history_screen -.->|"reads history"| node_history
node_user -.->|"edits terms"| node_dictionary_screen
node_dictionary_screen -.->|"manages entries"| node_dictionary
node_user -.->|"chooses models"| node_models_screen
node_models_screen -.->|"requests downloads"| node_model_download
node_user -.->|"sets up app"| node_onboarding
node_update_screen -->|"checks updates"| node_update_service

click node_shortcut "https://github.com/karansinghgit/speaktype/blob/main/desktop/src-tauri/src/platform/mod.rs"
click node_recorder "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Overlays/MiniRecorderView.swift"
click node_window "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Controllers/MiniRecorderWindowController.swift"
click node_audio "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/AudioRecordingService.swift"
click node_transcription "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/Transcription/TranscriptionManager.swift"
click node_whisper "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/WhisperService.swift"
click node_parakeet "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/Transcription/ParakeetEngine.swift"
click node_engine_contract "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/Transcription/SpeechToTextEngine.swift"
click node_model_catalog "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Models/AIModel.swift"
click node_model_download "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/ModelDownloadService.swift"
click node_model_storage "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Utilities/ModelStorage.swift"
click node_dictionary "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/DictionaryService.swift"
click node_history "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/HistoryService.swift"
click node_clipboard "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/ClipboardService.swift"
click node_desktop_ui "https://github.com/karansinghgit/speaktype/tree/main/desktop/src/screens"
click node_routes "https://github.com/karansinghgit/speaktype/blob/main/desktop/src/app/routes.ts"
click node_dashboard "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Dashboard/DashboardView.swift"
click node_history_screen "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/History/HistoryView.swift"
click node_dictionary_screen "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Dictionary/DictionaryView.swift"
click node_models_screen "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Settings/AIModelsView.swift"
click node_onboarding "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Onboarding/OnboardingView.swift"
click node_update_service "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/UpdateService.swift"
click node_update_screen "https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Components/UpdateSheet.swift"

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_recorder,node_window,node_audio,node_user toneBlue
class node_transcription,node_whisper,node_parakeet,node_engine_contract,node_model_catalog,node_model_download toneAmber
class node_model_storage,node_dictionary,node_history toneMint
class node_desktop_ui,node_routes,node_dashboard,node_history_screen,node_dictionary_screen,node_models_screen,node_onboarding,node_update_service,node_update_screen toneRose
class node_shortcut,node_clipboard,node_target_app toneIndigo
```

## Components

### Dictation capture

- [Recorder pill](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Overlays/MiniRecorderView.swift): `speaktype/Views/Overlays/MiniRecorderView.swift`
- [Recorder window](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Controllers/MiniRecorderWindowController.swift): `speaktype/Controllers/MiniRecorderWindowController.swift`
- [Audio recording](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/AudioRecordingService.swift): `speaktype/Services/AudioRecordingService.swift`

### Speech and models

- [Transcription router](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/Transcription/TranscriptionManager.swift): `speaktype/Services/Transcription/TranscriptionManager.swift`
- [Whisper engine](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/WhisperService.swift): `speaktype/Services/WhisperService.swift`
- [Parakeet engine](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/Transcription/ParakeetEngine.swift): `speaktype/Services/Transcription/ParakeetEngine.swift`
- [Engine contract](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/Transcription/SpeechToTextEngine.swift): `speaktype/Services/Transcription/SpeechToTextEngine.swift`
- [Model catalog](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Models/AIModel.swift): `speaktype/Models/AIModel.swift`
- [Model downloads](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/ModelDownloadService.swift): `speaktype/Services/ModelDownloadService.swift`

### Local data

- [Model storage](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Utilities/ModelStorage.swift): `speaktype/Utilities/ModelStorage.swift`
- [Dictionary cleanup](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/DictionaryService.swift): `speaktype/Services/DictionaryService.swift`
- [Dictation history](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/HistoryService.swift): `speaktype/Services/HistoryService.swift`

### App experience

- [Desktop screens](https://github.com/karansinghgit/speaktype/tree/main/desktop/src/screens): `desktop/src/screens`
- [Screen routes](https://github.com/karansinghgit/speaktype/blob/main/desktop/src/app/routes.ts): `desktop/src/app/routes.ts`
- [Dashboard and stats](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Dashboard/DashboardView.swift): `speaktype/Views/Screens/Dashboard/DashboardView.swift`
- [History screen](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/History/HistoryView.swift): `speaktype/Views/Screens/History/HistoryView.swift`
- [Dictionary screen](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Dictionary/DictionaryView.swift): `speaktype/Views/Screens/Dictionary/DictionaryView.swift`
- [Model settings](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Settings/AIModelsView.swift): `speaktype/Views/Screens/Settings/AIModelsView.swift`
- [Onboarding](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Screens/Onboarding/OnboardingView.swift): `speaktype/Views/Screens/Onboarding/OnboardingView.swift`
- [Version updates](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/UpdateService.swift): `speaktype/Services/UpdateService.swift`
- [Update dialog](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Views/Components/UpdateSheet.swift): `speaktype/Views/Components/UpdateSheet.swift`

### Desktop integration

- [Shortcut capture](https://github.com/karansinghgit/speaktype/blob/main/desktop/src-tauri/src/platform/mod.rs): `desktop/src-tauri/src/platform/mod.rs`
- [Clipboard and paste](https://github.com/karansinghgit/speaktype/blob/main/speaktype/Services/ClipboardService.swift): `speaktype/Services/ClipboardService.swift`

### Other components

- **User**
- **Focused app**

## Connections

- User → Shortcut capture: holds shortcut (evidence: `README.md`)
- Shortcut capture → Recorder pill: starts dictation
- Recorder window → Recorder pill: hosts view (evidence: `speaktype/Controllers/MiniRecorderWindowController.swift`)
- Recorder window → Audio recording: signals recording (evidence: `speaktype/Controllers/MiniRecorderWindowController.swift`)
- Recorder pill → Audio recording: records audio (evidence: `speaktype/Views/Overlays/MiniRecorderView.swift`)
- Recorder pill → Transcription router: requests transcription (evidence: `speaktype/Views/Overlays/MiniRecorderView.swift`)
- Transcription router → Whisper engine: routes by model (evidence: `speaktype/Services/Transcription/TranscriptionManager.swift`)
- Transcription router → Parakeet engine: routes by model (evidence: `speaktype/Services/Transcription/TranscriptionManager.swift`)
- Transcription router → Dictionary cleanup: cleans transcript (evidence: `speaktype/Services/Transcription/TranscriptionManager.swift`)
- Whisper engine → Engine contract: conforms to (evidence: `speaktype/Services/Transcription/TranscriptionManager.swift`)
- Parakeet engine → Engine contract: conforms to (evidence: `speaktype/Services/Transcription/ParakeetEngine.swift`)
- Model catalog → Transcription router: selects engine (evidence: `speaktype/Services/Transcription/TranscriptionManager.swift`)
- Model downloads → Model storage: stores models (evidence: `speaktype/Services/ModelDownloadService.swift`)
- Model downloads → Model catalog: uses catalog (evidence: `speaktype/Services/ModelDownloadService.swift`)
- Model downloads → Transcription router: loads selected model (evidence: `speaktype/Services/ModelDownloadService.swift`)
- Whisper engine → Model storage: loads local models (evidence: `speaktype/Services/WhisperService.swift`)
- Recorder pill → Dictation history: records dictations (evidence: `speaktype/Views/Overlays/MiniRecorderView.swift`)
- Recorder window → Clipboard and paste: pastes result (evidence: `speaktype/Controllers/MiniRecorderWindowController.swift`)
- Clipboard and paste → Focused app: inserts text (evidence: `README.md`)
- User → Desktop screens: uses app screens (evidence: `README.md`)
- Desktop screens → Screen routes: uses navigation
- User → Dashboard and stats: views activity (evidence: `README.md`)
- User → History screen: reviews dictations (evidence: `README.md`)
- History screen → Dictation history: reads history
- User → Dictionary screen: edits terms (evidence: `README.md`)
- Dictionary screen → Dictionary cleanup: manages entries
- User → Model settings: chooses models (evidence: `README.md`)
- Model settings → Model downloads: requests downloads
- User → Onboarding: sets up app (evidence: `README.md`)
- Update dialog → Version updates: checks updates (evidence: `speaktype/Views/Components/UpdateSheet.swift`)
