Running the app as a desktop app
Running the app as a desktop app
Section titled “Running the app as a desktop app”The desktop app reuses the exact same shell, plugins, store and event bus as the web app. Only the service adapters differ at runtime: on the desktop, file open/save, preferences and notifications go through Tauri instead of the browser.
Layout
Section titled “Layout”| Path | Purpose |
|---|---|
desktop/index.html |
HTML entry for the desktop (static SPA, no SSR) |
src/desktop/main.tsx |
Mounts ServicesProvider → KernelProvider → shell |
vite.desktop.config.ts |
Static build → dist-desktop/ with relative paths |
src-tauri/ |
Rust shell, config, capabilities, icons |
Prerequisites (on your machine, once)
Section titled “Prerequisites (on your machine, once)”- Rust (
https://rustup.rs) - Linux only:
webkit2gtk-4.1,libayatana-appindicator3,librsvg2,build-essential - macOS: Xcode command line tools · Windows: MSVC build tools + WebView2
Rust is not available in the Lovable sandbox, so the native binary must be compiled locally — the web build of the desktop bundle is verified here.
Commands
Section titled “Commands”bun installbun run desktop # native window with hot reload (tauri dev)bun run desktop:build # release binary + installers in src-tauri/target/release/bundleFront-end only, without the native window:
bun run desktop:build:web # writes dist-desktop/Permissions
Section titled “Permissions”src-tauri/capabilities/default.json grants the dialog, file read/write, store
and notification permissions the services layer needs, with file access scoped
to the user’s home, Documents, Desktop and Downloads folders. Widen or narrow
the fs:scope entry there.
src-tauri/icons/ holds placeholder PNG/ICO icons. Replace them with your own,
or regenerate the full set (including macOS .icns) with:
bunx tauri icon path/to/logo.pngVerified behaviour
Section titled “Verified behaviour”Against the packaged dist-desktop/ bundle: the shell boots, all three built-in
plugins activate, Open… loads a file from disk into a tab, and
Notes: Save document (⌘K / Ctrl+K command palette) writes the edited contents
back out. On the desktop these calls hit the native dialogs and filesystem.
Help topics
Section titled “Help topics”The documentation topics (docs/topics/) and their manifest are bundled by Vite
into dist-desktop/ as lazy chunks (import.meta.glob), so F1 help works with
no network. Nothing is read from disk at runtime.
Documentation under CC BY 4.0 · © SCFlow contributors ·Back to supplychainflow.org