Skip to content

Integrate Supabase for cloud-synced clients and sessions#3

Open
hsalaman1 wants to merge 1 commit intomainfrom
claude/supabase-sessions-clients-fMEyw
Open

Integrate Supabase for cloud-synced clients and sessions#3
hsalaman1 wants to merge 1 commit intomainfrom
claude/supabase-sessions-clients-fMEyw

Conversation

@hsalaman1
Copy link
Copy Markdown
Owner

Adds email/password auth, an offline-first Dexie-to-Supabase sync layer, and a one-time local-to-cloud migration on first login so therapists can review client notes and per-session data across devices.

  • supabase/migrations/0001_init.sql: clients + sessions tables with JSONB behavior_data and RLS scoping every row to auth.uid()
  • src/lib/supabase.ts, auth.tsx, authContext.ts, useAuth.ts: Supabase client and AuthProvider exposing user/session/signIn/signUp/signOut
  • src/lib/sync.ts: pushClient/pushSession/delete helpers, pullAll, and a Dexie-backed syncQueue that queues writes while offline and flushes on reconnect; migrateLocalToCloud runs once per user on first login
  • src/pages/LoginPage.tsx: sign-in/sign-up form
  • src/App.tsx: RequireAuth wrapper, /login route, sign-out button, and a post-login effect that runs migrate -> flushQueue -> pullAll
  • ClientsPage, ClientFormPage, SessionPage: write to Dexie first (keeps auto-save snappy) and fire pushClient/pushSession/delete*Remote after

https://claude.ai/code/session_01DBzhxzHuHsdrAH18wTvyJn

Adds email/password auth, an offline-first Dexie-to-Supabase sync layer,
and a one-time local-to-cloud migration on first login so therapists can
review client notes and per-session data across devices.

- supabase/migrations/0001_init.sql: clients + sessions tables with JSONB
  behavior_data and RLS scoping every row to auth.uid()
- src/lib/supabase.ts, auth.tsx, authContext.ts, useAuth.ts: Supabase client
  and AuthProvider exposing user/session/signIn/signUp/signOut
- src/lib/sync.ts: pushClient/pushSession/delete helpers, pullAll, and a
  Dexie-backed syncQueue that queues writes while offline and flushes on
  reconnect; migrateLocalToCloud runs once per user on first login
- src/pages/LoginPage.tsx: sign-in/sign-up form
- src/App.tsx: RequireAuth wrapper, /login route, sign-out button, and a
  post-login effect that runs migrate -> flushQueue -> pullAll
- ClientsPage, ClientFormPage, SessionPage: write to Dexie first (keeps
  auto-save snappy) and fire pushClient/pushSession/delete*Remote after

https://claude.ai/code/session_01DBzhxzHuHsdrAH18wTvyJn
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aba-data-collection Ready Ready Preview, Comment Apr 9, 2026 11:59am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants