Skip to main content

Three state layers

  1. UI state (Jotai): transient interface state.
  2. Content state (Y.js): authoritative editor content model.
  3. Cache state (React Query): metadata and request cache.

Save path

  • Editor updates Y.Doc locally.
  • Y.Doc persists in IndexedDB and syncs across tabs.
  • Binary Y.Doc state is sent to API and stored in Postgres.
This preserves local-first behavior while keeping the server persistence model simple.