Full StackJun 2026
Alcovia
Offline-first study app with two-device sync
The problem
Students study on more than one device and often without internet. Progress made offline on one device must merge cleanly with the other — without trusting device clocks and without double-counting rewards.
How it works
- 01Device A / B (offline)
- 02Local Lamport clock
- 03/sync API
- 04SQLite + n8n webhook
What I built
- Expo (web) client with focus timer, syllabus tree and a dev panel to simulate offline mode.
- Zustand store persisted to namespaced localStorage per device.
- Express + SQLite sync API with row-level Lamport clocks.
- Idempotent reward processing and async n8n webhooks.
Highlights
Deterministic convergence
Higher Lamport clock wins, with device ID as a tie-break, so both devices always end in the same state.
Safe retries
Each focus session has a UUID checked against a processed-sessions table, so retries never double-reward.
Trade-offs written down
CRDTs were considered and rejected as overkill for toggling statuses; known failure modes are documented.
Stack
TypeScriptExpoZustandExpressSQLiten8n
Next case study
SkillSwap