Replace Supabase auth with Clerk#6
Merged
Merged
Conversation
Swap Gary's built-in Supabase login/signup flow for Clerk so the app can run as a protected one-person web app on Vercel. - Add @clerk/nextjs; wrap the root layout in ClerkProvider - Add Clerk middleware (proxy.ts) that protects every route except /login and /signup - Render Clerk SignIn/SignUp at the existing /login and /signup URLs - Back the useAuth() compatibility hook with Clerk instead of Supabase - Replace the sidebar account dropdown with Clerk UserButton - Send the Clerk session token on backend requests via a shared helper - Remove the Supabase client, JWT helper, and @supabase/* frontend deps - Document Clerk env vars and setup in the env examples and docs The separate Express backend still verifies Supabase JWTs; swapping it to verify Clerk tokens is a documented follow-up. https://claude.ai/code/session_018GMAE164ehpBTxzBdsof9r
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced May 20, 2026
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
Replaces Gary's built-in Supabase login/signup/auth flow with Clerk, so the app can run as a protected one-person web app on Vercel. The old login system is removed — there are no two competing auth systems left in the UI.
Scope is intentionally limited to authentication: no billing, organizations, RBAC, invitations, multi-tenant isolation, DB migrations, or new product features.
What changed
Clerk integration
@clerk/nextjs; bumpedreact/react-domto^19.2.3(Clerk peer requirement). Bothbun.lockandpackage-lock.jsonsynced.src/proxy.ts— Clerk middleware (Next.js 16proxy.ts). Confirmed bynext buildasƒ Proxy (Middleware).<ClerkProvider>inside<body>./loginand/signuppreserved as URLs, now catch-all routes rendering Clerk<SignIn>/<SignUp>.useAuth()is now a thin Clerk-backed compatibility hook ({ user: {id,email}, isAuthenticated, authLoading, signOut }) so the ~15 consuming components needed no rewrite.<UserButton>(with an "Account settings" link to/account).Removed old auth
src/lib/supabase.ts,src/lib/auth.ts,src/app/login/page.tsx,src/app/signup/page.tsx, theAuthProvider, and the@supabase/*frontend deps.mikeApi.ts+ 7 components/hooks) now attach the Clerk session token via a sharedsrc/lib/apiToken.tshelper instead ofsupabase.auth.getSession().Routes
/login,/signup, static assets.Docs / env
frontend/.env.local.example,frontend/.env.vercel.example,docs/VERCEL_DEPLOYMENT.md,README.mdupdated with Clerk setup, env vars, andNEXT_PUBLIC_vs secret warnings. Stale Supabase-auth wording removed.Data scoping & backend — important
This PR is app-level protected only. Gary is effectively single-user; per-user data partitioning is not implemented here.
The separate Express backend still verifies Supabase JWTs and does not yet verify Clerk tokens. The frontend already sends the Clerk session token, so the documented follow-up is to swap the backend's
requireAuthto verify Clerk JWTs. Until then, data-accessing features depend on that follow-up. This is called out indocs/VERCEL_DEPLOYMENT.md.Env vars added
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,CLERK_SECRET_KEY,NEXT_PUBLIC_CLERK_SIGN_IN_URL,NEXT_PUBLIC_CLERK_SIGN_UP_URL,NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL,NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL.Test plan
next build— passes (compiles + TypeScript clean); builds without Clerk keys (keys only needed at runtime).src/lib/clerkAuth.test.ts— 13 checks, all pass.Recommended next PR
Update the backend
requireAuthmiddleware to verify Clerk JWTs (via Clerk's JWKS) and map the Clerk user ID onto Gary's existing data model.https://claude.ai/code/session_018GMAE164ehpBTxzBdsof9r
Generated by Claude Code