This boilerplate is pre-wired for:
- Email/password auth
- Magic-link auth
- Google OAuth auth
- Protected and guest route guards via
src/common/app-routes.ts - User role provisioning (
user_roles) - Profile provisioning and edit flow (
profile)
pnpm installCopy and edit env values:
cp .env.example .env.localRequired vars:
DATABASE_URLSUPABASE_URLSUPABASE_SECRET_KEYNEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYNEXT_PUBLIC_APP_URL(recommended, especially for OAuth redirects)
In Supabase Dashboard:
- Enable Email provider.
- Enable Google provider (if you need Google login).
- Set Site URL to your app URL (for local:
http://localhost:3000). - Add redirect URL:
http://localhost:3000/auth/callback(and your production callback URL).
Push Drizzle schema (creates user_roles and profile tables):
pnpm db:pushpnpm dev- Guest-only routes:
/login,/register,/magic-link - Protected routes:
/dashboard,/post-login,/account/* - Guard logic:
src/proxy.ts - Safe redirect sanitization:
src/common/redirects.ts