Worth is a balance tracking desktop app built with Tauri 2 (Rust) + Nuxt 4 (Vue 3, TypeScript).
- Designed to track a daily balance for each account, entered manually by the user
- A missing day means the balance is unchanged since the previous stored value
- All data is stored locally only (not saved in the cloud)
- Frontend: Nuxt 4, Nuxt UI 4, TailwindCSS 4, TypeScript, TanStack Vue Query, ECharts
- Desktop: Tauri 2 (
@tauri-apps/api,@tauri-apps/cli) - Backend: Rust 2024,
tokio,sqlx(SQLite) - Type sharing:
specta/tauri-spectageneratesapp/generated/bindings.tsviasrc-tauri/src/bin/export_bindings.rsschemars/gardegeneratesapp/generated/schemas/*.schema.jsonviasrc-tauri/src/bin/export_schemas.rsjson-schema-to-zodgeneratesapp/generated/zod/*.tsviaapp/scripts/generate-zod.mjs
app/: Nuxt app (pages/components/composables/plugins)nuxt.config.ts: Nuxt config (SSR off; staticnuxt generateoutput)src-tauri/: Tauri/Rust app + configsrc-tauri/src/api/: Tauri commands + DTOs (#[tauri::command])src-tauri/src/db/: Rust DB helpers/queriessrc-tauri/db/: SQL migrations + seed scriptssrc-tauri/src/bin/db.rs: DB dev CLI (seed/backup/restore/clear)src-tauri/src/bin/export_bindings.rs: exports TS bindings
- Start with
docs/README.mdand read the relevant document before changing a documented subsystem.
# install dependencies (repo enforces bun)
bun install
# desktop dev (Nuxt dev server + Tauri)
bun run tauri:dev
# build desktop bundle
bun run tauri:build
# typecheck
bun run check:<ts|rust|all>
# lint and format
bun run lint:<ts|rust|all>[:fix]
# database operations
bun run db <backup|restore|seed|clear|clean|help>
# export Rust contract types to app/generated/*.ts
bun run contracts:gen- Prereqs: install the OS toolchain per Tauri prerequisites.
- Node version:
.nvmrc(currently 24); Bun is the supported package manager (package.jsonpreinstall guard).
Problems running cargo commands ("rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured")? Try this:
- Set
CARGO_HOME = %USERPROFILE%\.cargo - Set
RUSTUP_HOME = %USERPROFILE%\.rustup - Add
%USERPROFILE%\.cargo\binto PATH prefix
- Default to pinning dependencies to the major version only.
- Tauri and its frontend counterparts must be pinned to the same minor version.
- Tauri plugins must be pinned to the same exact version across Rust and frontend packages.
- Engine: SQLite via
sqlx. - DB file location (runtime):
AppLocalData/db/worth.sqlite(on Windows this is under%LOCALAPPDATA%/<bundle id>/db/). - Migrations:
src-tauri/db/migrations(run on app startup insrc-tauri/src/lib.rs). - Seed/backup/restore CLI (operates on the same app-local DB,
bun run db --help)
-
Database queries:
src-tauri/src/db/mod.rs -
Models returned from queries:
src-tauri/src/db/mod.rs(query/aggregate/join result structs) -
Database table models:
src-tauri/src/db/rows.rs(every table must have an up-to-datesqlx::FromRowmodel here) -
API response models (DTOs):
src-tauri/src/api/mod.rs(types returned over IPC; map DB models to DTOs) -
Frontend API wrapper:
app/composables/useApi.tswraps commands frombindings.tsand automatically unwrapsResult<T, ApiError>toT.
- Avoid writing helper functions that are only used once; prefer to inline the code (including in Vue templates, where appropriate).
- TanStack Query must be used for all data fetching.
- In Rust, prefer iterators over loops.
- In Vue, prefer existing Nuxt UI components over custom elements (where possible). View the available components and a link to their docs at https://ui.nuxt.com/llms.txt.
- This is a greenfield project, so there is no need to maintain backwards compatibility.
- Avoid compatibility markers or schema versions for artifacts where the producer and consumer ship together.