What is Tauri?
Tauri is a framework for building desktop applications using web technologies for the UI and Rust for the backend. Unlike Electron, which bundles Chromium and Node.js, Tauri:- Uses the OS’s native webview (WebView2 on Windows, WebKit on macOS/Linux)
- Results in much smaller binaries (typically 10-20x smaller than Electron)
- Provides better performance with lower memory usage
- Offers a stricter security model with capability-based permissions
Tauri configuration
Yasumu’s Tauri app is defined inapps/yasumu/src-tauri/Cargo.toml:
Key dependencies
- tauri: Core framework
- deno_runtime / deno_core: Embedded JavaScript runtime
- tokio: Async runtime for Rust
- serde / serde_json: Serialization for IPC
- rustls: TLS implementation for HTTPS requests
Application lifecycle
The Tauri app lifecycle is managed inlib.rs:
Initialization flow
Tauri commands
Tauri commands are Rust functions that can be called from the frontend via IPC. Yasumu defines several commands:on_frontend_ready
Called when the Next.js frontend has loaded:
get_rpc_port
Returns the port where Tanxium’s RPC server is listening:
respond_to_permission_prompt
Forwards permission decisions to Tanxium:
Window management
Yasumu creates a single main window with platform-specific styling:- macOS: Native title bar with transparent overlay
- Windows/Linux: Custom-drawn title bar for consistent styling
Plugin system
Tauri plugins extend the application with native capabilities:| Plugin | Purpose |
|---|---|
| window-state | Persists window position and size |
| updater | Auto-update functionality |
| dialog | Native file picker dialogs |
| store | Persistent key-value storage |
| http | HTTP client (for Tanxium) |
| fs | Filesystem access |
| os | OS information |
Security model
Tauri’s security is built on capabilities and allowlists:- No eval by default: The frontend can’t execute arbitrary code
- Explicit IPC: Only registered commands are callable
- Scoped filesystem: Access is limited to allowed directories
- Content Security Policy: Strict CSP prevents XSS attacks
IPC security
All communication between frontend and backend goes through type-safe Tauri commands:Development vs production
Yasumu behaves differently in development and production:Development mode
- DevTools open automatically
- Hot module replacement enabled
- More verbose logging
Production mode
- Optimized bundles
- Code signing (macOS/Windows)
- Auto-update enabled
- Crash reporting
Building and bundling
The build process involves several steps:-
Build Tanxium: Compile TypeScript to a single JavaScript bundle
-
Build Next.js: Create static export
-
Bundle Tauri: Compile Rust and package everything
- Windows:
yasumu.exe(installer) - macOS:
Yasumu.app(DMG or PKG) - Linux:
yasumu(AppImage, deb, rpm)
Resource management
Tanxium’s JavaScript bundle is embedded as a resource:State management
Tauri manages global state usingapp.state():
Next steps
- Tanxium runtime - Learn about the embedded JavaScript runtime
- Frontend architecture - Explore the Next.js UI layer
- RPC layer - Understand frontend-backend communication