Local-first data architecture
Business rules never talk to storage directly. Use cases depend on a driver contract; adapters decide where data lives.
-
Repositories behind an
IDrivercontract: IndexedDB (Dexie) on the web, the filesystem on desktop. - Document and review outboxes with coalescing, leases and an immutable sync scope per cycle.
- A tested sync engine (push, pull, lease, checkpoint) and a server with monotonic change cursors.