This guide covers development for both desktop and mobile applications, which are now unified under the Tauri v2 framework.
- Install Rust: Follow the instructions at rustup.rs.
- Install Tauri Prerequisites: Follow the official guide for your operating system at tauri.app/v2/guides/getting-started/prerequisites. This includes dependencies for both desktop and mobile development (e.g., Android Studio, Xcode).
- Install Node.js and pnpm: We recommend using Node.js 20+ and pnpm 9+.
-
Install project dependencies:
pnpm install
-
Run the development server:
This will start the Vite dev server for the Svelte frontend and launch the Tauri application shell.
-
Desktop:
pnpm tauri dev
-
Mobile (Android):
Connect an Android device or start an emulator, then run:
pnpm tauri android dev
-
Mobile (iOS):
Connect an iOS device or start a simulator, then run:
pnpm tauri ios dev
-
src/: Svelte frontend code (components, stores, utils).src-tauri/: Rust backend code.src/main.rs: Main entry point for the desktop application.src/lib.rs: Shared Rust library for all platforms (desktop and mobile).tauri.conf.json: The main Tauri configuration file.Cargo.toml: Rust dependencies.build.rs: Tauri build script.
.github/workflows/: GitHub Actions for CI/CD and releases.
Tauri uses an Inter-Process Communication (IPC) bridge to allow the Svelte frontend to call Rust functions. All IPC commands are defined in src-tauri/src/lib.rs within the #[tauri::command] attribute.
The frontend interacts with these commands via the @tauri-apps/api JavaScript library. See src/utils/tauri-bridge.js for examples.
Service Workers are not supported in Tauri's webview. To provide offline functionality, we use a "sync shim" architecture:
-
src/utils/sync-core.js: A platform-agnostic module containing the core logic for handling API synchronization and mutation queues. It's a factory function that accepts an environment object (fetch,indexedDB,postMessage). -
public/sw-sync.js: The Service Worker adapter. It importssync-core.jsand provides the SW environment bindings. This is used for the web version. -
src/utils/sync-shim.js: The main-thread replacement for the Service Worker. It also importssync-core.jsbut provides main-thread environment bindings (window.fetch,window.indexedDB, and aCustomEvent-basedpostMessage). This is used in Tauri builds. -
src/utils/sync-bridge.js: A unified module that automatically detects the platform and initializes either the Service Worker or the sync shim. The rest of the application imports from this bridge, making the code platform-agnostic.
Tauri's functionality is extended through plugins. We use several official plugins, configured in src-tauri/Cargo.toml and src-tauri/src/lib.rs:
tauri-plugin-updater: For automatic background updates on desktop.tauri-plugin-notification: For native desktop and mobile push notifications.tauri-plugin-deep-link: To handleforwardemail://custom protocol URLs.tauri-plugin-single-instance: Ensures only one instance of the desktop app can run.tauri-plugin-window-state: Persists window size and position on desktop.
To build the application for production:
# Desktop
pnpm tauri build
# Mobile (Android)
pnpm tauri android build
# Mobile (iOS)
pnpm tauri ios buildThis will generate optimized, signed (if configured) binaries in src-tauri/target/release/.
We use Playwright for end-to-end testing. The tests are located in tests/e2e/.
tests/e2e/tauri/: Tests specifically for the Tauri application.tests/e2e/websocket/: Tests for the WebSocket client.
To run the tests:
# First, build the Tauri app in debug mode
pnpm tauri build --debug
# Then, run the Playwright tests
npx playwright test tests/e2e/tauri/The GitHub workflow in .github/workflows/e2e-apps.yml runs these tests automatically on every push.
For a comprehensive testing guide, see TAURI_TESTING.md.
- ARCHITECTURE.md — Full architecture document
- RELEASES.md — Release process and artifact details
- SECRETS.md — Required secrets for CI/CD
- SECURITY.md — Security hardening and code signing
- TAURI_TESTING.md — Comprehensive Tauri testing guide
- Desktop Contributing — Desktop architecture and IPC patterns
- Desktop Setup — Desktop environment setup
- iOS Setup — iOS simulator, signing, CI, and TestFlight setup
- Desktop CI Secrets — Desktop signing-specific secret setup