Ir al contenido

Desktop app

Esta página aún no está disponible en tu idioma.

The primary UI is a Tauri desktop app (apps/desktop/): a native window that renders the web frontend on top of the daemon. The app is self-contained — chronosd ships inside the bundle as a sidecar (Tauri externalBin, landing at Contents/MacOS/chronosd on macOS). The shell starts the daemon if nothing is serving the dashboard and stops it again on exit; a daemon that was already running is left alone.

It is a standalone Cargo workspace (its own [workspace] in src-tauri/Cargo.toml), intentionally excluded from the repo’s main workspace so just ci does not build it.

Install the Tauri CLI once:

Terminal window
cargo install tauri-cli --version "^2" # provides the `cargo tauri` subcommand

Platform webview requirements: macOS uses the system WebKit, Windows needs WebView2, Linux needs webkit2gtk.

Generate the real app icons from the brand asset (once):

Terminal window
cd apps/desktop/src-tauri
cargo tauri icon ../../../res/logo_app.png # writes icons/ in all required formats
Terminal window
just desktop # dev: prepare-sidecar.sh && cargo tauri dev
just desktop-build # distributable .app + .dmg (host arch)
# → apps/desktop/src-tauri/target/release/bundle/{macos,dmg}/

prepare-sidecar.sh builds chronosd in release mode and stages it at src-tauri/binaries/chronosd-<triple>. Tauri bundles that binary into the .app and places it next to the dev binary for cargo tauri dev, so the shell always finds its sidecar first.

At startup, src-tauri/src/main.rs resolves the daemon (sidecar → PATH → workspace target/), spawns it if the dashboard port is not serving, waits for the port, and opens a native window on the loopback dashboard (http://127.0.0.1:4173). On exit it terminates only the daemon it spawned — graceful signal first, hard kill as a backstop — and never touches one that was already running.

The release pipeline builds Chronos-<version>-<target>.dmg for both macOS architectures (see Releasing). Builds are unsigned unless the codesign secrets are present — first launch of an unsigned app needs right-click → Open, or:

Terminal window
xattr -dr com.apple.quarantine /Applications/Chronos.app
  • Talk to the daemon directly from the Tauri Rust backend over IPC (the chronos-contract socket) instead of the loopback HTTP gateway.
  • Bundle the frontend as a built frontendDist instead of loading it over loopback, and adopt packages/ui (React) when it lands.