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

Apps

Active contributors: Douwe de Vries

Purpose

The app layer covers deployable and runtime units that use the shared anonymization core. CSV Anonymizer currently has two units:

  • Desktop app, the React and Tauri product used by end users.
  • CLI smoke harness, the lightweight Rust binary path used for command-line inspection and release smoke checks.

Both units keep sensitive-data behavior in crates/csv-anonymizer-core and avoid duplicating detection, selection, transformation, or report logic.

Directory layout

Path Role
frontend/src React renderer, workflow components, hooks, Tauri command wrappers, settings UI, and theme handling
src-tauri/src Tauri shell, command registration, settings store, file grants, background jobs, and Local AI integration
src-tauri/tauri.conf.json Desktop runtime, CSP, window, and bundle configuration
crates/csv-anonymizer-app/src CLI entry point and argument handling for the smoke harness
crates/csv-anonymizer-core/src Shared Rust detection, preview, transformation, direct-input, Smart replacement, and reporting services
scripts/rust-smoke.mjs Node smoke script that builds or reuses the CLI binary and verifies fixture anonymization

Key abstractions

Abstraction Used by Notes
Runtime unit Desktop app and CLI smoke harness A process that users or automation can run.
Tauri command boundary Desktop app Typed frontend wrappers call Rust command handlers through invoke.
AnonymizerService Desktop app and CLI smoke harness Owns CSV analysis, preflight, preview, streaming anonymization, and reports.
Direct-input module Desktop app Powers paste and quick workflows through Tauri commands.
Smoke command CLI smoke harness Runs a representative analyze, preview, and anonymize path against the shared core.

How it works

graph TD
    Desktop[Desktop app] --> Tauri[Tauri command shell]
    Tauri --> Core[Shared Rust core]
    Cli[CLI smoke harness] --> Core
    Core --> Csv[CSV IO and direct-input parsing]
    Core --> Detect[Detection and metadata]
    Core --> Transform[Strategies and Smart replacement]
    Core --> Report[Privacy report]
Loading

The desktop app is the primary runtime. It renders CSV file, paste sample, and quick generation workflows, then calls Tauri commands from frontend/src/tauri.ts. The Tauri shell validates desktop access, runs blocking Rust work away from the renderer, and delegates anonymization behavior to the core crate.

The CLI smoke harness is intentionally smaller. It exercises the same AnonymizerService from a terminal process for analyze, anonymize, and --smoke-anonymize checks. Release and CI scripts use this route to verify that the Rust binary can transform a fixture without leaking known source emails.

Integration points

Entry points for modification

  • Add or change user-facing app workflow routing in frontend/src/App.tsx.
  • Add or change command wrappers in frontend/src/tauri.ts and matching Tauri handlers under src-tauri/src/commands/.
  • Keep reusable privacy behavior in crates/csv-anonymizer-core/src so the desktop app and CLI smoke harness stay aligned.
  • Update CLI behavior in crates/csv-anonymizer-app/src/cli.rs only when command-line smoke needs change.
  • Update scripts/rust-smoke.mjs when the smoke fixture contract changes.

Key source files

File Why it matters
frontend/src/App.tsx Selects the runtime UI mode and mounts settings, theme, and workflow components.
frontend/src/tauri.ts Single typed frontend surface for Tauri command calls.
src-tauri/src/main.rs Builds the Tauri runtime and registers managed state plus command handlers.
src-tauri/tauri.conf.json Defines desktop window, security policy, build commands, and bundle metadata.
crates/csv-anonymizer-app/src/cli.rs Parses and runs CLI smoke harness commands.
scripts/rust-smoke.mjs Runs the packaged Rust smoke path used by local and release checks.

Clone this wiki locally