← all projects

project2026local-first

Racha

A group expense splitter that works without internet and converges when it is back.

the problem

Splitting expenses happens exactly where the internet fails: trips, shared houses, barbecues. "Offline" apps only cache; when two phones edit the same expense without a connection, the balances diverge, and with money that is not acceptable.

my role

Solo project: architecture, domain, front end and sync.

highlights

  1. The local database (Dexie/IndexedDB) is the source of truth; Supabase is a background detail. An outbox pushes changes when there is a connection, and realtime only tells other devices to fetch what changed.
  2. Conflicts resolved with last-write-wins per field unit: amount, split type and shares change together, so a merge never mixes one device's amount with another's split. Balances are never synced: they are always recomputed.
  3. Money as integer cents with deterministic rounding: R$ 100 ÷ 3 becomes 3334 + 3333 + 3333 on every device.
  4. A domain with 100% coverage and a property test (fast-check): across thousands of random combinations, a group's balances always sum to zero. Installable PWA and e2e tests with Playwright.

stack

  • Angular
  • Ionic
  • Dexie
  • Supabase
  • fast-check
  • Playwright