This project is a Next.js application using Supabase for waitlist subscribers.
- Install dependencies:
npm install- Copy
.env.exampleto.env.localand set:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEYNEXT_PUBLIC_GA_MEASUREMENT_ID(optional)NEXT_PUBLIC_BACKEND_API_URL(default:http://localhost:4000)BACKEND_API_URL(server-side backend URL for API routes)BACKEND_INTERNAL_API_TOKEN(must match backendINTERNAL_API_TOKEN)
Legacy aliases NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY and NEXT_PUBLIC_SUPABASE_ANON_KEY still work.
- In Supabase SQL Editor, run:
supabase/schema.sql
- Verify waitlist database setup:
npm run waitlist:checkIf this command fails with PGRST205, your app is pointed at a Supabase project where
public.subscribers does not exist yet (or schema cache has not reloaded).
To use the email OTP flow in this app:
-
In Supabase Dashboard -> Authentication -> URL Configuration:
- Set
Site URLto your app origin (for local:http://localhost:3000). - Add redirect URL(s), including
/auth/callback(for local:http://localhost:3000/auth/callback).
- Set
-
In Supabase Dashboard -> Authentication -> Email Templates:
- For signup/login templates, include
{{ .Token }}in the email body. - If the template only uses
{{ .ConfirmationURL }}, users will receive a magic link instead of an OTP code.
- For signup/login templates, include
-
Run the app:
npm run devOpen http://localhost:3000 in your browser.
Set these environment variables in Vercel project settings:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEYNEXT_PUBLIC_GA_MEASUREMENT_ID(optional)NEXT_PUBLIC_BACKEND_API_URLBACKEND_API_URLBACKEND_INTERNAL_API_TOKEN
Legacy aliases NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY and NEXT_PUBLIC_SUPABASE_ANON_KEY remain supported.