๐ ๏ธ Developmentยถ
DailyCost Vault is a Tauri v2 + Vite + TypeScript strict + Rust/SQLite full-stack project โ one codebase covering Windows / macOS / Linux / Android / iOS / Web.
Source layout
The app source and browser extension both live in this repo:
BunnyChen-Item-Bookkeeping/โ app source (frontendsrc/+ backendsrc-tauri/)dailycost-exporter-extension/โ browser extension (Taobao / JD.com / Steam order export)
Requirementsยถ
| Dependency | Version | Purpose |
|---|---|---|
| Node.js | 22+ | Frontend build (Vite) |
| pnpm | 11+ | Package manager |
| Rust | stable (1.88+) | Backend & desktop build |
| Tauri CLI | via project (pnpm scripts) | Desktop / mobile build |
Platform system dependencies (see official Tauri Prerequisites):
- Windows: Microsoft C++ Build Tools ("Desktop development with C++") + WebView2 (bundled with Win10/11)
- macOS: Xcode (Command Line Tools is enough for desktop)
- Linux (Debian/Ubuntu):
libwebkit2gtk-4.1-dev,build-essential,curl,wget,file,libxdo-dev,libssl-dev,libayatana-appindicator3-dev,librsvg2-dev
Quick Startยถ
1. Install dependenciesยถ
2. Browser-only development (no Rust needed)ยถ
Pure frontend hot-reload โ great for iterating on UI and interaction logic.
3. Desktop development (Tauri window + hot-reload)ยถ
Starts the Vite dev server and opens a desktop window; frontend changes hot-reload instantly, Rust changes require recompilation.
4. Rust backend compile checkยถ
Checks whether the Rust code compiles, without producing a binary.
Create Your First Tauri Project (init)ยถ
Want to scaffold your own Tauri app from scratch? Tauri offers two approaches โ this project itself was created via create-tauri-app (TypeScript + pnpm + Vanilla template).
Option 1: create-tauri-app scaffold (recommended)ยถ
Run in the directory where you want the project (pnpm recommended):
# Interactive wizard
pnpm create tauri-app
# Or non-interactive (Linux / macOS)
sh <(curl https://create.tauri.app/sh)
Follow the prompts:
| Prompt | This project chose |
|---|---|
| Project name | dailycost-vault |
| Identifier | com.bunnychen.dailycostvault |
| Frontend language | TypeScript / JavaScript |
| Package manager | pnpm |
| UI template | Vanilla |
| UI flavor | TypeScript |
After scaffolding:
Option 2: Add Tauri to an existing frontend (Tauri CLI)ยถ
If you already have a frontend project (Vite / Next.js / โฆ), initialize the backend with the Tauri CLI:
# 1. Install the Tauri CLI (dev dependency)
pnpm install -D @tauri-apps/cli@latest
# 2. Initialize Tauri (interactive prompts)
pnpm tauri init
# โ What is your app name?
# โ What should the window title be?
# โ Where are your web assets located? โ dist
# โ What is the url of your dev server? โ http://localhost:5173
# โ What is your frontend dev command? โ pnpm dev
# โ What is your frontend build command? โ pnpm build
This creates a src-tauri/ directory. If you use Vite, ignore src-tauri in vite.config.ts to avoid hot-reload conflicts:
Finally, run pnpm tauri dev to verify. Full walkthrough: Tauri Create a Project.
Project Structureยถ
BunnyChen-Item-Bookkeeping/
โโโ index.html # Single-page entry
โโโ package.json # Frontend scripts & dependencies
โโโ vite.config.ts # Vite config
โโโ tsconfig.json # TypeScript strict config
โโโ src/ # Frontend source (TypeScript + vanilla DOM, no framework)
โ โโโ main.ts # Entry point
โ โโโ ui-home.ts # Home (asset wall / filters / cards)
โ โโโ ui-settings.ts # Settings page
โ โโโ ui-analytics.ts # Analytics page
โ โโโ ui-share.ts # Share & reports
โ โโโ db.ts # Database access
โ โโโ prefs.ts # Preferences
โ โโโ theme.ts / themes.ts # Theme system
โ โโโ emoji.ts / custom-emoji.ts # Emoji system
โ โโโ i18n.ts # i18n (zh / en / zh-TW)
โ โโโ types.ts / utils.ts / aggregate.ts
โ โโโ locales/ # Translations
โโโ src-tauri/ # Rust backend
โโโ src/ # Rust source (Tauri commands / SQLite)
โโโ Cargo.toml # Rust dependencies
โโโ tauri.conf.json # App config (identifier / window / updater)
โโโ capabilities/ # Permission capabilities
โโโ icons/ # Platform icons
โโโ gen/ # Android / iOS generated projects
The frontend uses vanilla TypeScript + DOM (no framework); the Rust backend exposes 30+ Tauri commands over IPC, with data stored in a local SQLite database.
Sample Dataยถ
src-tauri/example-data.dbโ bundled sample database (generated by a script)src-tauri/generate_example_db.pyโ sample data generatorsrc/assets/example-data.json/example-incomes.jsonโ frontend sample data
Click "Load sample data" in the app to try the full feature set without importing anything.
Official Docsยถ
For details, refer to the official Tauri documentation:
| Topic | Link |
|---|---|
| Prerequisites | v2.tauri.app/start/prerequisites |
| Create a Project | v2.tauri.app/start/create-project |
| Project Structure | v2.tauri.app/start/project-structure |
| Tauri CLI Reference | v2.tauri.app/reference/cli |
| Develop | v2.tauri.app/develop |
Next Stepsยถ
- Build & packaging โ ๐ฆ Build & Packaging
- User guide โ ๐ Installation