Documentation Index
Fetch the complete documentation index at: https://docs.laportenard.com/llms.txt
Use this file to discover all available pages before exploring further.
System diagram
Data flow
- Bootstrap — Terminal authenticates via JWT, fetches full config + catalog + floor plan from Odoo
- Local operations — Orders are created and edited locally in the reducer, persisted to IndexedDB via Dexie
- Sync — Changes broadcast through the hub to other terminals in real-time
- Upstream — Completed orders are forwarded from the hub to Odoo via
POST /pos-api/v1/hub/batch-sync - Offline — Terminals continue working with local data; changes queue in the outbox until connectivity returns
Key design decisions
Offline-first with IndexedDB
Offline-first with IndexedDB
All order data is persisted to IndexedDB (Dexie) immediately. The system remains fully functional without network connectivity. Sync happens opportunistically.
Domain-driven frontend
Domain-driven frontend
Business logic lives in
src/domain/ as pure functions, completely decoupled from React. This makes the core logic testable without component rendering.XState for complex workflows
XState for complex workflows
Session lifecycle, order state transitions, and sync status are modeled as explicit state machines, preventing impossible states.
Hub as broadcast broker
Hub as broadcast broker
The sync hub is a thin WebSocket relay — it doesn’t own business logic. Terminals remain authoritative over their own orders.