Aller au contenu

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.

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
  • 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.

Fenêtre de terminal
bun install
bun run desktop # native window with hot reload (tauri dev)
bun run desktop:build # release binary + installers in src-tauri/target/release/bundle

Front-end only, without the native window:

Fenêtre de terminal
bun run desktop:build:web # writes dist-desktop/

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:

Fenêtre de terminal
bunx tauri icon path/to/logo.png

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.

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 sous licence CC BY 4.0 · © les contributeurs de SCFlow ·Retour à supplychainflow.org