Architecture Overview
SlasshyWispr is a Tauri-based desktop application combining a TypeScript/Vite frontend with a Rust backend, providing voice dictation and AI assistant capabilities with support for online, offline, and hybrid model routing.Frontend
TypeScript + ViteModern web UI with Tauri API bindings
Backend
RustHigh-performance native operations and system integration
Core Technologies
Frontend Stack
- Framework: TypeScript + Vite
- UI: Custom CSS with shadcn-ui patterns
- Window Management: Tauri WebviewWindow API
- Global Shortcuts:
@tauri-apps/plugin-global-shortcut - IPC: Tauri invoke API for frontend-backend communication
Backend Stack
- Framework: Tauri 2.10.0
- Language: Rust (edition 2021)
- HTTP Client: reqwest with rustls-tls
- Audio Processing: hound, transcribe-rs
- ML Runtime: ONNX Runtime (ort 2.0.0-rc.10)
- Serialization: serde + serde_json
- Secure Storage: keyring (credential management)
The application uses Tauri’s commands system to expose Rust functions to the TypeScript frontend via asynchronous IPC calls.
Tauri Commands System
SlasshyWispr exposes backend functionality to the frontend through Tauri commands. These are Rust functions annotated with#[tauri::command] that can be invoked from TypeScript:
All Tauri commands are asynchronous and return
Result<T, String> types, automatically serialized to JSON for the frontend.State Management
The backend maintains a globalAppState structure managed by Tauri’s state system:
- Thread-safe using
Mutex<T>for concurrent access - Shared HTTP client with connection pooling
- TTL-based cleanup for cached contexts
- Real-time download progress tracking
IPC Communication Patterns
Request-Response Pattern
Most commands follow a synchronous request-response model:- Frontend sends request via
invoke() - Backend processes in Rust
- Response serialized and returned to TypeScript
Event Emission Pattern
For real-time updates (e.g., download progress):- Backend emits events via
app.emit() - Frontend listens with event listeners
- UI updates reactively
The AppState uses mutex-protected slots with automatic expiration for temporary data like selection contexts (TTL-based cleanup).
Key Dependencies
Rust Backend
| Package | Version | Purpose |
|---|---|---|
tauri | 2.10.0 | Desktop framework |
transcribe-rs | 0.2.5 | Speech-to-text (Parakeet) |
reqwest | 0.12 | HTTP client |
ort | 2.0.0-rc.10 | ONNX Runtime bindings |
serde/serde_json | 1.0 | Serialization |
keyring | 3 | Secure credential storage |
hound | 3.5 | Audio file I/O |
base64 | 0.22 | Audio encoding |
TypeScript Frontend
| Package | Version | Purpose |
|---|---|---|
@tauri-apps/api | 2.10.1 | Tauri JavaScript bindings |
@tauri-apps/plugin-global-shortcut | 2.3.1 | Hotkey registration |
vite | 7.3.1 | Build tool |
typescript | 5.9.3 | Type safety |
The application uses
rustls-tls instead of OpenSSL for TLS, providing a pure-Rust networking stack without external dependencies.Security Features
- Credential Storage: System keyring integration for API keys
- Windows Data Protection: DPAPI encryption on Windows (
CryptProtectData/CryptUnprotectData) - Secure HTTP: rustls-tls with certificate validation
- No Local API Key Storage: Credentials stored in OS-level secure storage
Next Steps
Architecture Details
Deep dive into component structure and pipeline architecture
Commands Reference
Complete list of available Tauri commands