skip to content
All posts

Set up a Tauri 2 + SolidJS desktop app on Windows

#tauri#solidjs#windows#desktop

Tauri 2 lets you ship a native desktop app with a web frontend and a Rust core, for a fraction of the size of an Electron build. This is the stack we use for our own apps, so here is the shortest path from nothing to a running window on Windows.

Prerequisites

You need three things installed once:

  1. Rust via rustup.
  2. Node.js (LTS) for the frontend tooling.
  3. The Microsoft C++ Build Tools and WebView2 runtime. WebView2 ships with current Windows 11, so most machines already have it.

Verify Rust is on your path:

Terminal window
rustc --version
cargo --version

Create the project

Tauri ships a scaffolder. Pick SolidJS with TypeScript when prompted:

Terminal window
npm create tauri-app@latest
# Project name: my-app
# Frontend language: TypeScript
# UI template: Solid
# UI flavor: TypeScript

Then install and run:

Terminal window
cd my-app
npm install
npm run tauri dev

A native window opens with hot reload. Edit src/App.tsx and the window updates instantly.

Call Rust from the frontend

The whole point of Tauri is a typed bridge to Rust. Define a command in src-tauri/src/lib.rs:

#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {name}!")
}

Register it in the builder:

tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running app");

Call it from SolidJS:

import { invoke } from "@tauri-apps/api/core";
const message = await invoke<string>("greet", { name: "world" });

Build a release

Terminal window
npm run tauri build

You get a signed-ready .msi and .exe installer under src-tauri/target/release/bundle/. The binary is small because the UI runs in the system WebView instead of bundling a browser.

Where to go next

  • Add auto-updates with the Tauri updater plugin and a release feed.
  • Lock down the capabilities file so the frontend can only call what it needs.
  • Keep the Rust side thin: do the heavy lifting there, keep the UI declarative.

That is the same foundation our desktop products are built on. If you want help taking an idea from this starting point to something you can ship, get in touch.