Open-Source Wikis

/

Tauri

/

Tauri

/

Architecture

tauri-apps/tauri

Architecture

Tauri is a polyglot toolkit. The Rust side compiles into the application binary and owns process lifecycle, IPC, security, plugins, and OS integration. The JavaScript side runs inside the system WebView and calls into Rust through a message-passing bridge. A separate set of build-time tooling (tauri-cli, tauri-bundler, tauri-codegen, tauri-build) turns a Tauri project into shippable installers.

This page describes how the pieces in this repo fit together. For per-crate detail see the crates/ section. For the cross-cutting subsystems (IPC, ACL, events, plugins) see systems/.

Layers

graph TD
    subgraph Frontend["Frontend (HTML/JS, system WebView)"]
        WebView["System WebView"]
        APIJS["@tauri-apps/api (TS)"]
    end

    subgraph TauriCore["Tauri Core (Rust, in-process)"]
        AppRs["tauri::App / AppHandle"]
        Manager["Window/Webview Manager"]
        IPC["IPC (commands, events, channels)"]
        ACL["ACL / Capabilities"]
        Plugins["Plugin system"]
    end

    subgraph Runtime["Runtime abstraction"]
        TauriRuntime["tauri-runtime (trait)"]
        TauriRuntimeWry["tauri-runtime-wry (impl)"]
        WRY["WRY"]
        TAO["TAO"]
    end

    subgraph Build["Build-time tooling"]
        CLI["tauri-cli"]
        Bundler["tauri-bundler"]
        Codegen["tauri-codegen"]
        BuildScript["tauri-build"]
    end

    APIJS -->|postMessage / invoke| IPC
    WebView --> APIJS
    IPC --> ACL
    IPC --> AppRs
    AppRs --> Manager
    AppRs --> Plugins
    Manager --> TauriRuntime
    TauriRuntime -. impl .-> TauriRuntimeWry
    TauriRuntimeWry --> WRY
    TauriRuntimeWry --> TAO
    CLI -->|invokes| Bundler
    CLI -->|cargo build| AppRs
    BuildScript -->|generates code| Codegen
    Codegen --> AppRs

Major components

Component Crate / Package Role
Application core crates/tauri Builder, App, AppHandle, window/webview management, plugin loop, IPC entry, scopes, resources
Runtime trait crates/tauri-runtime Stable-shape Runtime trait that decouples Tauri from WRY/TAO
WRY runtime impl crates/tauri-runtime-wry Bridges tauri-runtime to WRY+TAO; routes window events into the Tauri event loop
Macros crates/tauri-macros #[command], generate_handler!, tauri::Builder derives, include_image!
Codegen crates/tauri-codegen Embeds assets, parses tauri.conf.json at compile time, generates the Context
Build script crates/tauri-build Runs in user app's build.rs; emits manifests, mobile globs, ACL bindings
Plugin scaffolding crates/tauri-plugin Build-time + runtime helpers consumed by plugin authors
Utilities crates/tauri-utils Config types (tauri.conf.json schema), assets, platform helpers, ACL types, HTML CSP injection
CLI (Rust) crates/tauri-cli tauri init/dev/build/bundle/android/ios/info/migrate/icon/signer/permission/capability/inspect
CLI (Node) packages/cli napi-rs wrapper that exposes tauri-cli as @tauri-apps/cli
Bundler crates/tauri-bundler Produces DMG/.app, AppImage/Debian/RPM, MSI/NSIS installers; updater bundles
WebDriver crates/tauri-driver E2E driver compatible with tauri.driver
macOS signing crates/tauri-macos-sign Codesign / notarize helper used by the bundler and CLI
Schema generator crates/tauri-schema-generator Generates config.schema.json and ACL JSON Schemas
Schema worker crates/tauri-schema-worker Cloudflare Worker that serves config schemas at https://schema.tauri.app
JS bindings packages/api TypeScript modules: app, core, event, path, window, webview, tray, menu, …

Process model

A Tauri application runs as a single OS process containing:

  • The TAO event loop on the main thread.
  • One or more native windows, each hosting a WRY webview.
  • The Rust application code (Tauri builder, commands, plugins, your business logic).
  • A Tokio runtime (tauri::async_runtime) for async commands and plugin tasks.

The frontend communicates with Rust through an in-memory IPC bridge — there is no localhost HTTP server. The bridge supports three traffic patterns: command invocations (invoke), events (emit/listen), and binary channels.

Build-time vs runtime

Tauri does meaningful work at three different times:

  1. At plugin/app build timetauri-build (in build.rs) and tauri-codegen parse tauri.conf.json, embed the frontend bundle, generate the Context type, generate ACL .json schemas from each plugin's permissions/, and emit Cargo manifests for mobile targets.
  2. At application startuptauri::Builder resolves the runtime, registers plugins, attaches the IPC handlers, and constructs the initial windows and webviews. The RuntimeAuthority is built from the resolved ACL and used to gate every command call.
  3. At packaging timetauri-cli invokes Cargo, then hands the resulting binary off to tauri-bundler, which produces installers and (optionally) an updater bundle signed with tauri-macos-sign/Minisign.

Repository conventions

  • Cargo workspace inheritance: shared metadata lives under [workspace.package] in the root Cargo.toml. Crates use authors.workspace = true etc.
  • All crates pin rust-version = "1.77.2" (workspace) — see Cargo.toml.
  • Release management uses covector with markdown change files in .changes/.
  • Every Rust file starts with the dual-license SPDX header. CI enforces this via .github/workflows/check-license-header.yml.
  • Supply-chain audits live under audits/ and supply-chain/ (cargo-vet).

For coding patterns and review expectations, see patterns and conventions.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Architecture – Tauri wiki | Factory