Set Up Supabase
1. Create a project
Go to supabase.com and create a new project. Note your Project URL and API keys from Settings → API.
2. Run migrations
Open the SQL Editor in your Supabase dashboard. Run each file in order:
apps/web/supabase/migrations/001_initial_schema.sql
apps/web/supabase/migrations/002_rls_policies.sql
apps/web/supabase/migrations/003_realtime.sql
apps/web/supabase/migrations/004_indexes.sql
3. Enable Realtime
Go to Database → Replication and toggle the messages table to enable Realtime.
4. Copy your keys
You'll need:
NEXT_PUBLIC_SUPABASE_URL— your Project URLNEXT_PUBLIC_SUPABASE_ANON_KEY— theanon / publickeySUPABASE_SERVICE_ROLE_KEY— theservice_rolekey