Architecture
This page summarizes the technical shape of the project for visitors. The full internal documentation lives with the source code, which is not public; this page is the public summary.
Stack
- Flutter / Dart, one codebase across iOS, Android, macOS, and Linux (Linux validated in CI; a Windows target is scaffolded).
- Localization in 43 languages via Flutter's gen-l10n; money is always formatted by the currency's own convention.
- Drift, a typed, reactive layer over SQLite, for the local database — one file per device, opened only by this app.
- Provider for state management; ViewModels extend
ChangeNotifier. - go_router for declarative routing.
- No backend for your books: no cloud storage, no telemetry, no analytics. The Pillar 3a tax estimate is calculated on the device from tax tables built into the app and sends nothing.
Layering: MVVM + Repository
The app is organized in layers, each with a single job:
- Views render UI and forward user actions. They hold no business logic and never call a Repository directly.
- ViewModels hold UI state, expose it as streams/listenables, and call into Repositories to read or change data.
- Domain modules (plain Dart) hold view-independent logic — in-progress form drafts, register/summary/home projections, navigation and lock policies — so it can be tested without any UI or database.
- Repositories are the single source of truth for a domain area — the only layer that talks to the database. Heavy paths such as signing-and-posting and chain verification are deep modules behind them, and the repositories' dependency graph is kept strictly acyclic.
Data flows one direction: Views listen to ViewModels, ViewModels use domain modules and call Repositories, Repositories talk to Drift. This keeps business logic out of widgets and out of the database layer, and makes each piece testable on its own.
Security And Privacy Stance
All ledger data stays on your devices, in a local SQLite database. There's no account to sign up for and no cloud sync; Linked devices sync only with your other devices on the same Wi-Fi, and ledger data is never sent to a server. The app's internet requests carry no ledger data: an opt-in reference exchange-rate lookup (a currency pair), investment market prices (on by default, can be turned off; a ticker or ISIN only), a one-time listing search when an instrument is added (its ISIN or ticker only), and the plan service, which checks which plan (Seed, Garden or Orchard) your books have paid for. See the privacy policy.
The device's signing identity lives in the OS-level secure keystore, not in the SQLite file itself, and never leaves the device; a Books Copy carries the books only, never the private key — and every posted journal entry is signed and hash-chained so that tampering with a past entry breaks verification from that point forward, detected the next time the app starts.
For users, this means the app treats unverifiable history as suspect instead of silently including it in balances. It is useful during backup restore, CSV export, accountant handoff, and any situation where the user needs to know whether old records still match what was originally posted. It is not a substitute for device security or backups, and it does not prove that a transaction was true when entered; it detects later hidden changes to the stored record.
The implementation is based on common integrity patterns: cryptographic hashes act as content fingerprints, digital signatures bind those fingerprints to the user's signing identity, and the hash chain makes history order-sensitive. See NIST on integrity, digital signatures, and hash functions, plus Schneier/Kelsey on secure audit logs and AWS QLDB's verifiable journal overview for industry context.
Full Documentation
The complete picture — project structure, data flow diagrams, the full
technology-choice rationale, and the engineering discipline (testing
rules, dependency policy, Definition of Done) — is kept in the internal
documents smara-architecture.md and smara-tech-guidelines.md, which
are not public. This page summarizes them.