Locent
A personal expense ledger that has no server. Everything lives on the device; backups are encrypted on the phone and pushed to a private folder in the owner's Google Drive.
- Period
- Context
- My role
The problem
Expense trackers ask you to hand your entire financial history to someone else's database. I wanted the opposite constraint: no backend at all, no account, no sync service — and still be able to get everything back on a new phone.
How it was built
The device is the source of truth
Data sits in SQLite on the phone, typed end to end with Drizzle so queries are checked at compile time and migrations are generated rather than hand-written. Repositories are the only query surface; money, dates and totals stay pure and driver-agnostic so they can be tested under Node without a device.
Backup with no server to trust
A backup is serialised, gzipped with fflate, encrypted with AES-256-GCM, and written to the Drive appDataFolder — a private area only this app can see. There is no bucket of mine anywhere in the path. The manifest carries the KDF parameters, the IV and a plaintext SHA-256, plus an explicit schema version so a newer install can still read an older backup.
Choosing instant over ceremonial
The first version derived the key from a user passphrase with PBKDF2 at 310k iterations. In pure JavaScript on Hermes that froze the UI for a second or two on every backup and every restore. It is a personal ledger, not a bank, and the file already lives in the user's own private Drive — so the key is now derived on-device from an app secret in a single hash. Backup became instant, and a fresh install can restore with nothing to remember.
Where it landed
- Zero backend: no servers, no accounts, no running costs
- Backup and restore are instant, and work on a phone the user has never signed into before
- Crypto is pure JavaScript, so the encrypt/decrypt round trip is covered by tests that run in CI without a device
Specification
- Runtime
- Data
- Crypto
- Backup
- Styling
- Builds