Online mode: Google OAuth, board privacy, and offline-aware sync#17
Merged
Conversation
Enable complete online operation with secure, account-scoped data: - Auth: unify auth into useAuth hook adding Google OAuth alongside the existing email magic-link; Home shows a Google button with email fallback. - Privacy: new profiles table (owner-only RLS) auto-provisioned from auth metadata via trigger; boards created while signed in default to private, with RLS gating pages/snapshots/assets on (is_public OR owner_id = uid). - Sharing: BoardAccessIndicator chip lets the owner flip a board between private and a collaborative shared link. - Identity: presence now uses the Google display name + avatar, derived only from the user's own session (never another user's profile row). - Offline: SaveStatus reports an offline state and that edits persist locally and resync on reconnect. - Docs: docs/SETUP.md covers Supabase, Google OAuth, and CI secrets; secrets stay out of the repo (.env* already git-ignored). https://claude.ai/code/session_015VWZXTJebcCq2EWZybJ6xi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes NotUX work as a complete online app — real-time multiplayer (already in place), Google sign-in, account-scoped privacy for annotations/login info, and graceful fallback to local-only mode when Supabase is unreachable. No secrets are added to the repo.
What changed
Authentication
useAuthhook (replacesuseMagicLink) adding Google OAuth (signInWithOAuth) alongside the email magic-link fallback.Homeshows a "Sign in with Google" button with an "or email instead" fallback.Privacy & data scoping (
supabase/migrations/0004_profiles_and_privacy.sql)profilestable (name, avatar, provider), owner-only RLS — a user's account info is readable only by themselves.pages/snapshots/assetsRLS now gates onis_public OR owner_id = auth.uid(), so private-board annotations are owner-only.Sharing
BoardAccessIndicatorchip lets the owner flip a board between 🔒 Private and a 🔗 Shared collaborative link.Identity / presence
Offline
SaveStatussurfaces an offline state and reassures that edits persist locally (IndexedDB) and resync on reconnect.Docs / config
docs/SETUP.md: end-to-end setup (Supabase keys, Google OAuth client, Supabase provider config, CI secrets, verification).supabase/config.toml: declares the Google provider (secrets via env) and the localhost callback URL..env*remain git-ignored;.env.localis not tracked.Manual steps required (documented in
docs/SETUP.md)https://<project>.supabase.co/auth/v1/callback.supabase db push(addsprofiles+ privacy RLS).VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY(no Google value needed at build time).Verification
pnpm -r typecheck✅pnpm -F @notux/web build✅docs/SETUP.md§5).Design note
Real-time collaboration and per-account privacy are reconciled by making signed-in users' boards private by default with explicit opt-in sharing, rather than the previous free-for-all-public default. Existing public boards keep working unchanged.
https://claude.ai/code/session_015VWZXTJebcCq2EWZybJ6xi
Generated by Claude Code