Tauri v2 desktop app patterns for StockFind. Includes monorepo integration, native features, build/release, and architecture decisions. Use when scaffolding, building, or configuring the desktop app.
GitHub: #164
| Decision | Choice |
|---|---|
| Framework | Tauri v2 (stable since Oct 2024) |
| Frontend | Existing Next.js web app (@stockfind/web) |
| Backend | Rust (minimal — mostly declarative config) |
| API | Same Hono RPC as web and mobile (client #3) |
| Location | apps/desktop/ |
@stockfind/types, @stockfind/utils, ) work as-is@stockfind/financialapps/
desktop/
src/ # Web frontend entry (points to web app)
src-tauri/
src/
main.rs # Rust entry point
lib.rs # Commands and native APIs
Cargo.toml # Rust dependencies
tauri.conf.json # Tauri configuration
capabilities/ # Permission definitions
icons/ # App icons (all platforms)
package.json
turbo.json
// apps/desktop/turbo.json
{
"extends": ["//"],
"tasks": {
"dev": {
"extends": false
},
"build": {
"extends": false
}
}
}
Desktop should be excluded from root pnpm dev and pnpm build — run explicitly via pnpm dev:desktop.
Add to root package.json:
{
"scripts": {
"dev:desktop": "turbo run desktop#dev",
"build:desktop": "turbo run desktop#build"
}
}
Desktop uses the same Hono RPC client as web:
import { hc } from "hono/client";
import type { AppType } from "@api/index";
const api = hc<AppType>(API_URL);
No backend changes needed — the desktop app is a web view making HTTP calls to the existing API.
| Feature | Plugin | Use Case |
|---|---|---|
| System tray | tauri-plugin-shell | Quick access, background presence |
| Notifications | tauri-plugin-notification | Price alerts, earnings reminders |
| Global shortcuts | tauri-plugin-global-shortcut | Quick stock lookup |
| Auto-updater | tauri-plugin-updater | Seamless updates |
| File system | tauri-plugin-fs | Export reports, data downloads |
| Deep links | tauri-plugin-deep-link | stockfind:// protocol |
| Platform | Format | Signing |
|---|---|---|
| macOS | .dmg, .app | Apple Developer ID |
| Windows | .msi, .exe (NSIS) | Code signing certificate |
| Linux | .deb, .AppImage | N/A |
Auto-updater uses GitHub Releases by default.
Tauri v2 supports iOS/Android but is not used for StockFind mobile:
Mobile stays on Expo + React Native.
tauri.conf.json. Only write Rust for custom native commands.