Skip to content

The Architecture: The Sandwich Model

To truly master Tauri, it helps to understand how it differs from a standard website or a Node.js application. Tauri applications are constructed like a sandwich, consisting of two distinct layers that work together to create a seamless experience.

The bottom bun of our sandwich is the Core Process. This is written in Rust. It is the entry point of your application and acts as the orchestrator. Because it is native code, it has full access to the operating system’s features—file systems, system trays, global shortcuts, and hardware interactions.

The Core Process is responsible for creating windows and managing the application lifecycle. It guarantees high performance and memory safety, thanks to Rust’s unique properties.

The top bun (and the tasty filling) is the WebView. This is the user interface layer where your HTML, CSS, and JavaScript live. If you are coming from web development, this is your playground. It renders your UI just like a browser does.

Native Web Renderers vs. Bundling Chromium

Section titled “Native Web Renderers vs. Bundling Chromium”

Here lies the secret to Tauri’s tiny footprint. Frameworks like Electron bundle the entire Chromium browser engine and Node.js runtime into every single application. This makes the app consistent but heavy (often 100MB+ for a ‘Hello World’).

Tauri takes a different approach. It relies on the web renderer already installed on the user’s Operating System:

  • Windows: Uses WebView2 (Edge/Chromium).
  • macOS: Uses WebKit (Safari).
  • Linux: Uses WebKitGTK.
  • Android/iOS: Uses the system’s native WebView.

By piggybacking on these existing libraries, Tauri apps can be incredibly small (often less than 5MB) and launch instantly.

The two layers (Rust Core and WebView) are isolated from each other for security. They communicate via a secure bridge known as Inter-Process Communication (IPC). The Frontend sends messages (requests) to the Core, and the Core sends responses back.

+------------------------------------------+
| Your Frontend (HTML/JS/CSS) |
| [ The UI Layer ] |
+---------------------+--------------------+
|
(IPC Bridge - JSON messages)
|
+---------------------+--------------------+
| Tauri Core (Rust) |
| [ Logic, FS, Database, OS Access ] |
+------------------------------------------+
|
[ Operating System ]