Emmanuel BalogunFrontend & Full-Stack Developer
--:--:-- WAT

05Fintech · Offline-first PWA

Ajo

An offline-first ledger for ajo and esusu savings circles

An installable web app for the person who keeps the book in a savings circle: who has paid, who is short and whose turn it is to collect. It works at the market with no signal, and when two phones edit the same week while out of touch, it shows both versions instead of quietly losing one.

Year
2026
Role
Frontend developer
Stack
React 19 · TypeScript · Automerge 3 (CRDT) · IndexedDB · Vite · vite-plugin-pwa (Workbox) · React Router · Vitest · Playwright + axe-core · GitHub Actions
Ajo’s contribution grid for an Ikeja market circle: paid, late and missed squares per member, the payout rotation along the top, and a card showing two versions of one member’s week 5 payment
PlateAfter reconnecting — two phones disagreed about week 5, and both versions are kept for a person to choose.
A — The problem

Ajo and esusu circles usually run from an exercise book or a WhatsApp group. The book-keeper is often at a market stall with poor signal, and two people may record the same payment differently. A ledger that keeps whichever edit came last can lose ₦10,000 without anyone noticing.

B — What it does
  • 01A contribution grid with paid, paid late, part paid, missed and due states; on phones it becomes one strip per member, with whoever owes money first.
  • 02Record payments with amount shortcuts and typed amounts like “20k”, then undo from the toast.
  • 03Rotation shows whose turn it is, what is in the pot and who is still short, and asks before paying out less than the full pot.
  • 04Start a circle in three steps or join one with a QR code, link or invite code; after joining, everything works offline.
C — Decisions & trade-offs
  1. D-01

    A CRDT instead of last-write-wins

    Each circle is one Automerge document and payments are keyed by member and round, so two phones writing the same square write the same key. Automerge never drops a concurrent write; the app reads its conflicts and shows both versions, and picking one clears the clash on every phone once they sync.

    Trade-offAutomerge’s wasm is about 1.2 MB gzipped, so the first visit is heavier; after that the service worker starts the app from cache.

  2. D-02

    A sync queue that is real, not a counter

    Every local edit records the hash of the change it made, and it only leaves the visible queue when the relay’s copy contains that hash. Each simulated phone has its own IndexedDB database, with writes merged inside one transaction so two tabs cannot overwrite each other.

    Trade-offMore bookkeeping than a simple “pending” flag, but the screen never claims something has synced when it hasn’t.

  3. D-03

    Totals by money, squares by history

    If someone missed week 2 and paid double in week 3, week 2 still reads “missed” because that is what happened, but their balance shows they owe nothing.

    Trade-offTwo views of the same member can look contradictory at first, so the key under the grid explains it.

D — Outcome
Offlinerecording, rotation and members all work with no signal
Bothversions kept when two phones edit the same week, for a person to settle
WCAG 2.2AA rules checked with axe on phone and desktop in the end-to-end tests
E — Known limits
  • There is no server yet: the relay lives inside one browser, so syncing works between tabs, not between two real phones.
  • No accounts or encryption at rest, so anyone with an invite link can join.