Architecture
The desktop app consists of:- Tauri Core - Rust-based native window and system integration
- Web Frontend - Vite-built React/TypeScript app
- Node.js Sidecar - Bundled Node.js runtime for local API server
- Static Resources - Data files, API handlers, and configuration
Prerequisites
Development
Run Desktop App in Dev Mode
- Syncs version numbers across
package.jsonandtauri.conf.json - Builds the sidecar sebuf gateway
- Starts Vite dev server
- Launches Tauri with hot reload
Dev Mode with Devtools
The dev script includes devtools by default:package.json
- Web Inspector (right-click → Inspect)
- Console logging
- Network monitoring
Build Configuration
Main Configuration
src-tauri/tauri.conf.json
Variant Configurations
Tech Monitor uses a merged configuration:src-tauri/tauri.tech.conf.json
Bundle Configuration
src-tauri/tauri.conf.json
Bundled Resources
../api/- Serverless API handlerssidecar/local-api-server.mjs- Local API serversidecar/node/- Bundled Node.js runtime../data/- Static datasets (GeoJSON, CSV, etc.)../src/config/- Configuration files
Building
Build for Current Platform
- World Monitor
- Tech Monitor
- Finance Monitor
Build Commands Explained
The build command chain:package.json
await build({
entryPoints: ['api/[domain]/v1/[rpc].ts'],
outfile: 'api/[domain]/v1/[rpc].js',
bundle: true,
format: 'esm',
platform: 'node',
target: 'node18',
treeShaking: true,
});
Packaging
Package Script
Thedesktop-package.mjs script handles multi-platform packaging:
Package Commands
Node.js Runtime Bundling
The package script automatically downloads and bundles the Node.js runtime:scripts/download-node.sh
Bundle Targets
- macOS
- Windows
- Linux
- app -
.appbundle - dmg - Disk image installer
src-tauri/target/release/bundle/Code Signing
macOS Signing
export TAURI_BUNDLE_MACOS_SIGNING_IDENTITY="Developer ID Application: Your Name (TEAM_ID)"
export TAURI_BUNDLE_MACOS_PROVIDER_SHORT_NAME="TEAM_ID"
xcrun notarytool submit \
src-tauri/target/release/bundle/dmg/World\ Monitor_*.dmg \
--apple-id "[email protected]" \
--password "app-specific-password" \
--team-id "TEAM_ID" \
--wait
# Staple notarization ticket
xcrun stapler staple src-tauri/target/release/bundle/dmg/World\ Monitor_*.dmg
Windows Signing
export TAURI_BUNDLE_WINDOWS_CERTIFICATE_THUMBPRINT="ABC123..."
npm run desktop:package:windows:full:sign
Linux Signing
Linux builds don’t require code signing, but you can sign AppImages:Distribution
Manual Distribution
- Build signed packages for each platform
- Upload to your website or file host
- Provide download links with SHA256 checksums
GitHub Releases
Automate releases with GitHub Actions:.github/workflows/release.yml
Update Mechanism
Tauri supports auto-updates with the updater plugin. Configure intauri.conf.json:
Troubleshooting
Build Fails on macOS
Error:xcrun: error: unable to find utility "metal"
Solution: Install Xcode Command Line Tools:
Windows Build Fails
Error:error: linking with 'link.exe' failed
Solution: Install Visual Studio Build Tools 2022 with C++ workload.
Linux Missing Dependencies
Error:webkit2gtk-4.1 not found
Solution: Install WebKit dependencies:
Sidecar Fails to Start
Error:Failed to spawn sidecar
Solution:
- Verify Node.js binary exists:
src-tauri/sidecar/node/node - Check execute permissions:
chmod +x src-tauri/sidecar/node/node - Rebuild sidecar:
npm run build:sidecar-sebuf
App Won’t Open on macOS
Error:"World Monitor" is damaged and can't be opened
Solution: Remove quarantine attribute: