Offline Backup app for User Accounts that runs and stores to a USB - Mac
README.md

Thumbelina #

Personal, offline accounts tracker meant for a USB key: double-click the Mac app, enter your password, and edit records. Nothing is stored in the cloud. The app does not phone home or depend on a subscription; long-term compatibility still depends on future macOS versions, the system WebKit used for the window, and shipping a CPU architecture your family Macs can run (use the universal release build below unless everyone is on the same chip).

Platform: The supported distribution is macOS (.app + UserData). Other platforms are not tested here. See LICENSE (MIT) and SECURITY.md.

What goes on the USB (for family) #

After you build once on your machine, copy to the USB:

Item Role
Thumbelina.app The app (from npm run tauri:build:universal on a Mac — see Release build).
UserData/ All personal data — encrypted vault.enc, optional settings.json, and optional per-account files under attachments/ (plain files, not inside the vault).
README_USB.md Optional short instructions (copy from this repo).

Your relative does not install Rust, Node, or Homebrew. They only open Finder and double-click Thumbelina.app.

If macOS blocks the app the first time, use Right-click → Open once (Mac Gatekeeper). See README_USB.md.

Apple notarization (optional, for family Macs) #

Apps that are only ad-hoc or locally signed are often blocked or require the extra Open step above. For the smoothest “double-click and run” experience on current macOS—especially for relatives who are not comfortable with security dialogs—you can distribute a build signed with an Apple Developer ID application certificate and notarize it with Apple, then staple the ticket to the app.

At a high level (exact commands change with Xcode tooling):

  1. Join the Apple Developer Program and create a Developer ID Application certificate in Xcode or the developer site.
  2. Configure Tauri / your build pipeline to sign Thumbelina.app with that identity (see Tauri signing and Apple’s notarytool documentation).
  3. After each release build, submit the app (or zip of the app) to Apple’s notary service, wait for Accepted, then run xcrun stapler staple on the .app so offline Macs trust the app.

Notarization does not replace your vault password; it only reduces macOS friction around who published the app binary. You still ship UserData separately on the USB as today.

Developer setup #

After unlock, the Help tab in the app carries a concise guide aligned with this README and README_USB.md. The lock screen has expandable Quick tips for Mac Gatekeeper and passwords.

  1. Install Rust and Tauri prerequisites for macOS.

  2. Clone the repo and install JS deps:

    cd thumbelina
    npm install
    
  3. Run the app in development:

    npm run tauri dev
    

    Data defaults to ./usb-dev/UserData/ under the project (created automatically). This folder is gitignored.

    Blank window? That comes from the WebView not loading the dev URL (nothing on port 1420, wrong host, or a race before Vite is ready) — not from dock icon assets in Rust. Always use npm run tauri dev so Vite and the app start together; dev is bound to 127.0.0.1 to match devUrl. If it’s still blank, confirm http://127.0.0.1:1420 opens in Safari while the app runs.

Optional: point data at a “fake USB” folder #

Set THUMBELINA_USB_ROOT to the folder you want to treat as the USB root. The app will use <THUMBELINA_USB_ROOT>/UserData/ for vault.enc and settings.

export THUMBELINA_USB_ROOT="/path/to/your/usb-mirror"
npm run tauri dev

Release build (what you copy to the key) #

Recommended (one universal .app for Apple Silicon and Intel): from the repo root on a Mac:

npm run tauri:build:universal

This runs scripts/build-macos-universal.sh: it ensures the aarch64-apple-darwin and x86_64-apple-darwin Rust targets are installed (no-op if already present), then builds with --target universal-apple-darwin. The frontend is still built via Tauri’s beforeBuildCommand (npm run build).

Take Thumbelina.app from src-tauri/target/universal-apple-darwin/release/bundle/macos/ and place it next to a UserData folder on the USB. At runtime the app resolves UserData as a sibling of the .app bundle when not using the env override.

Single-arch only (not for mixed family USBs): npm run tauri build produces a native binary for the Mac you built on; output lives under src-tauri/target/release/bundle/macos/ (path may vary slightly by Tauri version).

Full-snapshot backups (Admin in the app) #

After unlock, Admin → Take a backup writes thumbelina-backup-YYYYMMDD-HHMMSS.zip next to your UserData folder. Each run is a new complete zip (not an incremental update to older backups). The archive includes top-level UserData files, the attachments/ subtree (account documents), and when you launched from a release .app beside UserData, the entire app bundle plus UserData/ and a short BACKUP.txt—enough to recreate the USB layout later. Development runs (tauri dev) typically zip UserData only; keep a release .app with those zips if you need a runnable archive.

Plain JSON/CSV (Admin): For spreadsheet or agent workflows you can download unencrypted JSON or CSV and merge them back into the vault. JSON includes both categories and accounts; import applies categories first (match by id: update name / sort_order, or insert with that id), then merges accounts the same way as before (match id to update; new rows insert; omitted accounts stay). Category names must remain unique—conflicting import rows are skipped with a warning. CSV is accounts only (no category rows). This is not a substitute for encrypted backups.

On launch, the app best-effort deletes stale vault.enc.tmp and settings.json.tmp files in UserData/ left over from an interrupted save.

For rebuilding identical source code years later, also keep a source snapshot (git tag or tarball); the backup zip does not include the Rust/React project tree.

Dock icon: During npm run tauri dev, we load src-tauri/icons/ (same files as the bundle) and set the Dock tile — no compositing in Rust (that path crashed the app). If it still looks rough, improve branding/icon-1024-square.png (transparent edges, padding inside the square) and run npx tauri icon … again. For the finished look in Finder/Dock, use npm run tauri:build:universal (or npm run tauri build) and open Thumbelina.app.

Regenerating icons: Source art is under branding/. After editing, run:

npx tauri icon branding/icon-1024-square.png

That overwrites the files in src-tauri/icons/.

Encryption (short) #

The vault file is encrypted at rest with Argon2id (key from your password) and XChaCha20-Poly1305. The database is SQLite kept in memory while unlocked and serialized into vault.enc when you lock or quit. Account documents (optional files you attach in the account editor) are stored separately under UserData/attachments/ as normal files; they are not encrypted with the vault, so treat them like any other file on the USB.

Account documents (uploads & storage) #

  • Where: UserData/attachments/<numeric account id>/ — one folder per saved account; folders are created when you first upload.
  • In the app: Unlock, open Accounts, click a row for Account details, then use Documents — Add file… and per-file delete. Save a new account once before attachments are available (the id must exist).
  • Limits: About 25 MB per file; filenames are sanitized (no path segments, length capped). Duplicate names get a renamed copy instead of overwriting.
  • Security: Attachments stay on disk as plain files beside vault.enc. They are not wrapped in vault encryption, so anyone with physical access to the USB can read them even when the app is locked.
  • Lifecycle: Deleting an account removes its folder under attachments/. Admin → Take a backup zips the attachments/ tree with the rest of UserData. Admin → Start over deletes attachments/ along with the vault and settings.

Blank copy for a friend #

  1. Copy Thumbelina.app (same build you use).
  2. Copy the empty templates/UserData folder from this repo to the USB and rename it to UserData (or delete vault.enc inside an existing UserData to reset).
  3. First launch runs Create vault again.

Strip only your data #

Delete UserData/vault.enc (and optionally UserData/settings.json and the UserData/attachments/ folder). The next launch behaves like a first-time setup.

You can also use Admin → Start over (erase everything) while the app is unlocked: it verifies your current vault password, then deletes vault.enc, settings.json, the attachments/ tree, and clears memory without writing the open database back to disk first (so unsaved edits are discarded).

Project layout #

  • LICENSE — MIT
  • SECURITY.md — how to report security issues
  • src/ — React + TypeScript UI
  • docs/ — maintainer notes (docs/vault-format.md, docs/PROGRAMMING_JUMPSTART.md for Cursor / coding after time away)
  • AGENTS.md — short pointer at repo root for AI assistants (links the jump-start doc)
  • src-tauri/ — Rust (paths, crypto, SQLite, Tauri commands)
  • templates/UserData/ — empty template for sharing

License #

Released under the MIT License. Dependencies (Rust crates, npm packages) remain under their respective licenses.