Desktop App Architecture
Relevant source files
The following files were used as context for generating this wiki page:
mausVoice is a cross-platform desktop application built using the Tauri v2 framework, combining a Rust-based native layer with a TypeScript/React frontend. The architecture follows a strict "Rust is the API, TypeScript is the Brain" philosophy, where business logic is centralized in the TypeScript layer while Rust provides high-performance access to system-level capabilities such as audio capture, keyboard injection, and local AI transcription sidecars.
The application serves as a voice-to-text tool that captures audio via global hotkeys, transcribes it using either local Whisper models or cloud providers (Deepgram), cleans the text using Large Language Models (LLMs like Groq), and injects the final result into the currently focused application.
Sources: llms.txt:13-24, apps/desktop/README.md:33-38
Core Architectural Components
The system is structured as a Turborepo monorepo, separating core application logic from reusable packages. The desktop application specifically splits responsibilities between the webview (Frontend) and the host process (Rust).
Frontend (TypeScript / React)
The frontend is the orchestrator of the application. It manages state via Zustand (with Immer for immutability) and defines the user interaction flow. Business logic is organized into "Actions" and "Repos". Actions compose utility functions and call Repos, which act as the gateway to either local storage (SQLite via Tauri commands) or external AI services.
Backend (Rust / Tauri)
The Rust layer serves as a type-safe API bridge. It provides access to:
- Native capabilities: Global hotkey listening and text injection into other apps.
- Audio Pipeline: Native audio recording and management.
- Sidecars: Execution of local transcription models (Whisper.cpp GGML/ONNX) outside the main process for performance.
- Storage: SQLite database management and encrypted key storage (XChaCha20-Poly1305).
Sources: llms.txt:30-41, CLAUDE.md:14-25, apps/desktop/DESIGN.md:92-106
High-Level Data Flow
The following diagram illustrates how a user event travels from the React interface through the business logic to the native Rust layer and back.
The data flow ensures that TypeScript makes all functional decisions while Rust performs the heavy lifting.
Sources: llms.txt:43-51, CLAUDE.md:27-31
Key Subsystems
Audio and Transcription Pipeline
The application supports both streaming and local transcription.
- Streaming: Utilizes Deepgram
nova-3for live transcripts. - Local: Utilizes
packages/rust_transcriptionas a sidecar to run Whisper.cpp or ONNX Parakeet/Canary models.
Sources: llms.txt:72-76, CLAUDE.md:33-35, README.md:46-52
Security and State Management
Security is enforced through a restrictive Content Security Policy (CSP) defined in tauri.conf.json. External API domains are allowlisted in the http:default permission set, ensuring they are reachable via fetch() but restricted from IPC command access.
| Feature | Implementation | Source File |
|---|---|---|
| State | Zustand + Immer | llms.txt:104 |
| Database | SQLite with migrations | CLAUDE.md:36-39 |
| Encryption | XChaCha20-Poly1305 for API keys | llms.txt:81-82 |
| IPC Type Safety | Specta-generated bindings | packages/desktop-native-apis/README.md:38-44 |
Sources: CLAUDE.md:49-59, apps/desktop/src-tauri/tauri.conf.json:20-25
UI Design System
The visual architecture is based on a "Surface Ladder" design, using elevation driven by luminance rather than shadows. It employs a monochrome system with two specific themes: "Cream Paper" for light mode and "Onyx" for dark mode.
| Tier | Light (Cream) | Dark (Onyx) |
|---|---|---|
| level0 (Background) | #F5F2ED | #0C0C0D |
| level1 (Surface) | #FDFBF8 | #161617 |
| level2 (Raised) | #ECE8E1 | #1F1F21 |
| level3 (Elevated) | #E0DBD2 | #2A2A2C |
Sources: apps/desktop/DESIGN.md:6-18
Project Structure Overview
The repository structure follows a monorepo pattern to share logic across the desktop app and its installers.
Sources: llms.txt:53-68, CLAUDE.md:10-13
Summary
The mausVoice desktop architecture is optimized for performance and privacy by delegating heavy computation to Rust sidecars while maintaining a flexible, logic-rich frontend in TypeScript. By utilizing Tauri v2, the application maintains a small resource footprint while providing robust native features like global hotkeys and system-wide text injection. The strict separation between the "Brain" (TS) and the "API" (Rust) facilitates easier cross-platform maintenance and clear data ownership.