Environment Setup:
bun install # Install dependencies
mkdir -p src-tauri/resources/models
curl -o src-tauri/resources/models/silero_vad_v4.onnx https://blob.handy.computer/silero_vad_v4.onnxDevelopment:
bun run tauri dev # Full app development
CMAKE_POLICY_VERSION_MINIMUM=3.5 bun run tauri dev # macOS with cmake fix
bun run dev # Frontend only (Vite)
bun run build # Build frontend
bun run tauri build # Production buildType Check & Build:
bunx tsc --noEmit # Type checking
bun run build # Build and validateRust (Backend):
- Use
anyhow::Errorfor error handling with descriptive messages - Prefer
Arc<Mutex<T>>for shared state in managers - Log with appropriate levels:
debug!,info!,eprintln!for errors - Builder pattern for initialization chains
- Snake_case for functions and variables, PascalCase for types
- Separate logical sections with comment blocks:
/* ─────────── */
TypeScript/React (Frontend):
- Functional components with TypeScript interfaces
- Zod schemas for type validation and inference
useCallbackhooks for stable function references- Destructure props with defaults:
disabled = false - Prefer interface aliases over type aliases for objects
- React.FC for explicit component typing
- PascalCase for components, camelCase for variables/functions
Imports:
- Group imports: external libs, internal modules, relative imports
- Use type imports for TypeScript:
import type { Settings } - Named imports preferred over default exports
Error Handling:
- Frontend: Try/catch with user feedback, rollback optimistic updates
- Backend:
?operator with anyhow context messages - Log errors appropriately for debugging level
Component Patterns:
- Container component pattern for layout
- Composition over inheritance
- Prop drilling minimized with context where appropriate