Architecture & Data Model

Frontend State

Zustand store maintains workbook state, selection, editing, formatting, history, and cloud sync status.

Persistence Layers

  • Local-first snapshot persistence (sql.js / idb fallback).
  • Supabase cloud persistence with auth-scoped RLS.
  • Versioned cloud snapshots for collaborative sync.

Supabase Schema Evolution

  • v1: per-cell cells model.
  • v2: row-wise JSON model (sheet_rows).
  • v3: workbook_snapshots + versioned commit RPC + change log.

Cost Strategy

Avoid one-row-per-cell growth. Use snapshot/version model to reduce write amplification and keep multi-user sync affordable.