Migrate a prototype from mock data to Supabase
Schema, policies, typed client and a one-file swap — the exact move from a Phase 1 prototype to a real backend.
This app currently reads from typed arrays in src/data. Move it to Supabase without changing any UI component. STEP 1 — SCHEMA For each collection, create a table matching the existing TypeScript type exactly, with snake_case columns, a uuid primary key, created_at and updated_at. Show me the SQL first. STEP 2 — POLICIES - Public read for rows where status = 'published'. - Insert, update and delete restricted to authenticated admin users. - Enable RLS on every table. No table ships without a policy. STEP 3 — DATA Generate insert statements from the existing seed arrays so nothing is lost. STEP 4 — CLIENT Implement the same repository interface already defined in the codebase, backed by Supabase queries. Map snake_case to the existing camelCase types in one place. STEP 5 — SWAP Change the single line where the repository is selected. No component may import the Supabase client directly. ACCEPTANCE CRITERIA - Every page renders identical content from the database. - Loading and error states exist for each async read. - Typecheck passes with no 'any'.