Northstar is a Tauri 2 app with a React/TypeScript frontend and Rust native shell. The frontend owns product UI, domain logic, and local-first workflows. Rust/Tauri owns native packaging, plugin access, SQLite, secure storage, and future platform integrations.
SQLite is the source of truth. Every domain object includes sync-ready metadata from day one:
idspaceIdrevisioncreatedAtupdatedAtdeletedAt
Repositories hide storage details from UI components. Local-only mode must keep working without Supabase.
Market data flows through MarketDataProvider. The first implementation is Yahoo Finance:
- chart endpoint for quote/history
- search endpoint for symbols
- FX pairs such as
USDTWD=X - default range
1y, interval1d - 60-second quote cache and 5-minute FX cache
Yahoo is acceptable for v1 but treated as replaceable.
Supabase is infrastructure, not a readable finance backend.
Supabase may store:
- encrypted sync envelopes
- encrypted key envelopes
- device metadata
- household membership metadata
- subscription metadata
- encrypted attachment blobs
Supabase must not store readable:
- transactions
- holdings
- balances
- cost basis
- net worth
- performance analytics
Account login answers "who is this user?" It does not answer "can this device decrypt the vault?"
- Personal Vault Key protects each user's private data.
- Household Space Key protects shared household projections.
- Trusted-device pairing is the preferred new-device path.
- Recovery Kit is the fallback when no trusted device is available.
Sync uses record-level encrypted envelopes, not whole-database overwrite.
Local write flow:
- Write to SQLite.
- Append mutation to local outbox.
- Encrypt payload locally.
- Push encrypted envelope to Supabase.
- Other devices pull by cursor, decrypt locally, and apply revisions.
Realtime is only a notification channel.
Household sharing does not expose a full personal vault. A user chooses accounts to share. Northstar publishes encrypted projections into a household space. Private notes and receipts are excluded by default.