Tauri Tutorial
Learn Tauri step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Tauri? Learn what Tauri is, how a Rust core and a system webview combine into small desktop and mobile apps, and when Tauri is a good choice for your project.
- Tauri vs Electron and Other Options Compare Tauri with Electron, native toolkits, Flutter and PWAs: size, performance, security, language and platform support, plus a simple decision helper.
- Install Tauri and Create Your First App Install the Tauri prerequisites on Windows, macOS and Linux, scaffold a project with create-tauri-app, run it in dev mode and understand each command you type.
- Tauri Project Structure Tour A guided tour of a Tauri 2 project: the frontend folder, src-tauri, Cargo.toml, tauri.conf.json, lib.rs, main.rs, capabilities and icons, and what each file is for.
- The Dev Loop and Building a Release Learn how tauri dev and tauri build work, how hot reload and rebuilds behave, how to debug the webview and the Rust core, and what a release build produces.
Architecture and Setup
- Tauri Architecture: Core, TAO, WRY and the Webview Understand how Tauri is built: the Rust core, the TAO windowing and WRY webview libraries, the IPC bridge, custom protocols and how one process hosts the UI.
- Configuration Files: tauri.conf.json and Cargo.toml Configure a Tauri 2 app: productName, identifier, build commands, windows, security CSP, bundle settings, platform overrides and Cargo features, with a validator.
- Frontend Frameworks and Bundlers with Tauri Use React, Vue, Svelte, Angular or plain HTML as a Tauri frontend: dev server settings, static output, SSR limits, the @tauri-apps/api package and how to detect Tauri at runtime.
- Rust Basics You Need for Tauri The Rust you need to write Tauri commands: variables, ownership and borrowing, structs, enums, Result and Option, the ? operator and derive macros like Serialize.
- State Management in Rust with Tauri Share application state across Tauri commands with manage() and State, protect it with Mutex or RwLock, choose between std and async mutexes, and see how it works.
Commands and Events
- Tauri Commands: Calling Rust from JavaScript Write your first Tauri commands: the #[tauri::command] attribute, generate_handler!, invoke() from JavaScript, return values, naming rules and organizing commands in modules.
- Command Errors: Result, thiserror and Custom Error Types Handle failures in Tauri commands: return Result, make error types serializable, use thiserror and enums, and catch rejected invoke() Promises in TypeScript.
- Async Commands and Long-Running Work in Tauri Keep your Tauri UI responsive: sync versus async commands, async fn with Tokio, spawn_blocking for heavy work, borrowed arguments, progress reporting and cancellation.
- Tauri Events: emit, listen and Messaging Between Windows Send messages both ways with Tauri events: emit and listen in Rust and JavaScript, typed payloads, targeting windows, one-time listeners, unlistening and when to use commands instead.
- Channels: Streaming Data from Rust to the Frontend Stream ordered, fast messages from Rust to JavaScript with Tauri channels: the Channel type, onmessage, typed enums, download progress, binary data and channels versus events.
Windows and Menus
- Tauri Windows: Create, Configure and Control Create and control Tauri windows: define them in tauri.conf.json, build them in Rust, use the JavaScript window API to resize, move, maximize, close and listen to window events.
- Multiple Windows, Child Webviews and Window Communication Open, reuse and coordinate several Tauri windows: spawn from JavaScript or Rust, avoid duplicates, share state, send messages between windows and add child webviews.
- Native Menus and Context Menus in Tauri Build native application menus in Tauri 2: MenuBuilder, SubmenuBuilder, items, checkboxes, accelerators, predefined items, menu events, context menus and per-window menus.
- Custom Title Bars, Transparency and Window Effects Build a custom title bar in Tauri: turn off decorations, add data-tauri-drag-region, wire minimize, maximize and close buttons, plus transparent windows, shadows and platform quirks.
- System Tray Icons in Tauri Add a system tray icon to a Tauri app: enable the tray-icon feature, build a TrayIconBuilder, attach a menu, react to clicks, update the icon and keep the app alive with no windows.
Plugins and Native Features
- The Tauri Plugin System Learn how Tauri 2 plugins extend your app with native features: installing, registering in Rust, importing the JavaScript API and granting permissions. Includes runnable stand-ins.
- Files and Dialogs in Tauri Read and write files with the Tauri fs plugin, pick files with native dialogs, use base directories and scopes safely, and try runnable stand-ins of path resolution and filters.
- Store, SQL and App Settings in Tauri Save settings with the Tauri store plugin, use SQLite through the sql plugin, pick the right storage for the data, and practice with runnable stand-ins of debounced saves and migrations.
- Notifications, Clipboard, Shortcuts and OS Info Use Tauri plugins for system notifications, clipboard, global keyboard shortcuts, opening links, OS information and single-instance apps, with runnable stand-ins of shortcut parsing.
- Writing a Custom Tauri Plugin Build your own Tauri 2 plugin: scaffold it, add commands, managed state and events, generate permissions, wrap it in a typed JavaScript API, and try a runnable stand-in of the plugin builder.
Security and Permissions
- The Tauri Security Model Understand how Tauri 2 protects users: the trust boundary between webview and Rust, what an attacker can reach, the layers of defense, and a runnable stand-in of a threat checklist.
- Capabilities and Permissions in Tauri 2 Learn how Tauri 2 capabilities, permissions and permission sets decide what each window may call. Covers file layout, platforms, remote URLs, deny rules and a runnable resolver stand-in.
- Scopes and Input Validation in Tauri Limit commands to certain paths, URLs and programs with Tauri scopes, and write Rust commands that validate untrusted input: path traversal, shell injection and size limits, with runnable models.
- CSP, Isolation and Hardening Tauri Apps Set a Content Security Policy for a Tauri app, use the isolation pattern to inspect IPC messages, freeze prototypes, audit dependencies and follow a release hardening checklist, with runnable models.
Mobile and Packaging
- Tauri Mobile Development for Android and iOS Build Android and iOS apps with Tauri 2 from one codebase: prerequisites, init, dev and build commands, the lib.rs entry point, mobile plugins, safe areas and responsive UI, with runnable stand-ins.
- Bundling, Installers and Code Signing in Tauri Turn a Tauri app into installers for Windows, macOS and Linux: bundle config, icons, formats, code signing and notarization, GitHub Actions builds, and a runnable bundle-config checker.
- Sidecars, Resources and Binary Size in Tauri Ship external programs as Tauri sidecars, bundle resource files, read them at runtime, and shrink your app with Cargo release settings. Includes runnable stand-ins for target triples and line streaming.
Testing and Updates
- Testing Tauri Apps: Rust Tests and Mocked IPC Test a Tauri app on both sides: Rust unit and integration tests with the mock runtime, frontend tests with mockIPC and mockWindows, test design tips, and runnable examples using node:test.
- End-to-End Testing and CI for Tauri Test the real Tauri app with tauri-driver and WebdriverIO, understand platform limits, write stable selectors and waits, run tests in GitHub Actions, and try a runnable retry and page-object stand-in.
- The Tauri Updater and Release Workflow Add in-app updates with the Tauri updater plugin: generate signing keys, configure endpoints, write latest.json, check and install updates from JavaScript, and release safely, with runnable stand-ins.
Projects and Practice
- Project: A Markdown Notes App with Tauri Plan and build a safe Markdown notes app with Tauri 2: project layout, Rust commands, file storage, capabilities, preview rendering with escaping, search and tests, with a runnable core model.
- Project: A Live System Monitor with Tauri Build a live CPU and memory monitor with Tauri 2: a Rust background task, the sysinfo crate, events versus channels, start and stop commands, a ring buffer and a text chart, with runnable models.
- Project: A Clipboard History Manager with Tauri Build a clipboard history manager with Tauri 2: clipboard plugin, global shortcut, tray icon, a popup window, duplicate and sensitive-data handling, and a runnable history model with search and pinning.
- Tauri Best Practices, Debugging and Practice Exercises Collect the habits of good Tauri apps: project structure, serializable errors, performance with large data, debugging tips, a final review checklist and hands-on exercises with runnable stand-ins.