Skip to content

background rust tauri rewrite

Douwe de Vries edited this page Jul 1, 2026 · 1 revision

Rust and Tauri rewrite

CSV Anonymizer's active architecture is a Rust core, a Tauri desktop shell, and a bundled React/Vite frontend. The historical source document is docs/rust-rewrite-plan.md.

Active contributors: Douwe de Vries

Current state

The rewrite is implemented. Production desktop packaging uses:

  • crates/csv-anonymizer-core for detection, metadata, deterministic hashing, strategies, sample reading, preview, streaming CSV anonymization, direct-input workflows, Smart replacement validation, and reports.
  • src-tauri for Tauri command registration, file dialogs, path grants, settings persistence, background jobs, output opening, and Local AI/Ollama integration.
  • frontend for the React/Vite UI bundled into Tauri.
  • crates/csv-anonymizer-app as a lightweight CLI and smoke-test harness for the shared Rust core.

See Architecture for the current layer map.

What was removed

The old Bun, Electrobun, Vue, and Electron-era runtime paths are no longer the active app architecture. The current CI and release workflows no longer install Bun. They build the Vite frontend once and require Tauri to consume frontend/dist through src-tauri/tauri.conf.json.

The TypeScript-only test surface that belonged to the older runtime was replaced by:

  • Rust tests in crates/csv-anonymizer-core, src-tauri, and crates/csv-anonymizer-app.
  • Frontend Vitest tests under frontend/src.
  • Playwright e2e and accessibility tests under frontend/e2e.
  • Scripted release, contract, audit, and smoke checks under scripts.

Current desktop runtime

Tauri starts from src-tauri/src/main.rs, manages shared stores, initializes the dialog plugin, and registers commands from src-tauri/src/tauri_command_list.rs.

Frontend command wrappers live in frontend/src/tauri.ts. They call commands for settings, file selection, CSV analysis, pasted data, quick values, anonymization jobs, and Local AI status/download actions.

Blocking CSV and Local AI work is moved off the UI thread through Tauri async workers and job stores in src-tauri/src/jobs.rs, src-tauri/src/job_registry.rs, and src-tauri/src/local_ai/download.rs.

Packaging after the rewrite

Release artifacts are written under dist/rust:

  • macOS .dmg installers are signed, notarized, stapled, and verified in .github/workflows/release.yml.
  • Linux .deb, .rpm, and AppImage artifacts are built through scripts/package-tauri-linux.mjs.
  • Linux package metadata is validated through scripts/validate_linux_package_metadata.py.
  • A signed APT repository is built through scripts/build_apt_repository.py and published through GitHub Pages.

The Tauri CLI version is pinned in CI and release workflows with TAURI_CLI_VERSION, matching the Tauri 2 line used by the Rust dependencies.

Active verification

The rewrite is guarded by the same checks described in Testing:

npm run frontend:build
npm run frontend:audit
npm run frontend:lint
npm run frontend:test
npm run frontend:e2e
npm run frontend:a11y
npm run deadcode:required
npm run cargo:audit:required
npm run tauri:prebuilt:check
cargo fmt --all --check
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
node scripts/rust-smoke.mjs
node scripts/check-release-metadata.mjs

Package checks are covered in Deployment.

Clone this wiki locally