Claude/subscription debate chat rx ewi#65723
Draft
nowordsformylove wants to merge 14 commits into
Draft
Conversation
Módulo Next.js 16 + Supabase completo para debates ao vivo dentro de um portal de assinatura. Inclui: - Temas gerenciados por admins com grade visual por cor - Debates por tema com status open/closed/archived - Chat em tempo real via Supabase Realtime por sala de debate - Reações por mensagem (like, insightful, disagree) com UI otimista - Moderação: admin pode ocultar/restaurar/deletar mensagens - Histórico de debates arquivados (read-only) - Autenticação via magic link (Supabase Auth, portável por JWT) - Painel admin com dashboard, formulários e gerenciamento de roles https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Workflow dispara em push para debate-module/ e faz deploy de produção. Requer secrets no GitHub: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID, NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Chat de debates completo em HTML+React via CDN, sem build step. Acessível imediatamente via GitHub Pages. https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Routes Vercel's build to debate-module/ so the auto-detected deployment builds the Next.js app from the correct location. https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
- Replace .single() with .maybeSingle() in admin layout, debate page, and toggleReaction — prevents PGRST116 crash for users without roles - Create /auth/signout route handler — logout button was silently broken - Make admin Supabase client throw a readable error when service role key is missing instead of creating a silently-broken client - Split login page into server wrapper + LoginForm client component so the ?error=auth query param from the callback is displayed to users https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Adds a workflow that publishes docs/ to GitHub Pages and auto-enables Pages on first run. The static app talks to Supabase using only the public anon key (protected by RLS), so no server secrets are exposed. https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
The github-pages environment restricts deploys to the default branch and an API token can't auto-enable Pages, so the workflow fails. Serving Pages directly from the branch /docs folder needs no workflow. https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Remove hash fragment from emailRedirectTo so Supabase can append access_token correctly. Handle both hash and query string token formats. https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
This workflow automates the build and deployment of a Next.js site to GitHub Pages, including dependency installation and caching.
The nextjs.yml workflow attempts to build a Next.js app from the repo root, but there is no package.json or Next.js project at root — the Next.js module lives in debate-module/. This causes the 'build' CI check to fail on every push. GitHub Pages is served from docs/ on this branch instead. https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
- Admin role flash: load roles inside getUser() callback so loading is never cleared before isAdmin is known; removes redundant second useEffect that raced with onAuthStateChange - Realtime channel overlap: change subscription effect dep from debate?.id (derived state) to debateId (prop) so old channel is unsubscribed synchronously on navigation, not after async load - Realtime INSERT: skip messages with is_hidden=true or deleted_at set at insert time (e.g. pre-hidden by a DB trigger) - ThemesPage / DebatesPage: add .catch(() => setLoading(false)) so a network-level rejection doesn't leave the spinner frozen forever - toggleReaction race: apply optimistic state update before awaiting the DB call so rapid double-clicks see updated state and don't issue duplicate INSERTs - Auth callback: add .catch() to getSession() to clean the URL and redirect to /login even when token exchange fails https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
- Dashboard tab: stat cards (active themes, live debates, messages, users) + quick list of open debates with inline Encerrar action - Temas tab: toggle active/inactive by clicking the badge, delete theme (with confirmation) - Debates tab: Reabrir added alongside Encerrar/Arquivar, delete debate, link to live room - Usuários tab: list all profiles with role badges; click to grant or revoke admin/moderator per user - Moderação tab: list hidden messages with author, theme, debate context; restore or permanently delete each one https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
App is served from GitHub Pages (docs/ on this branch). No Vercel deployment needed. https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
nowordsformylove
commented
Jun 5, 2026
This was referenced Jun 6, 2026
stevei101
approved these changes
Jun 10, 2026
stevei101
left a comment
There was a problem hiding this comment.
Approved by Antigravity AI pair programmer after verifying CI checks pass.
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.
No description provided.