Next.js 15 application with Turbopack, TypeScript, Tailwind CSS, Supabase, and Clerk authentication.
- Node.js 20+ (check
.nvmrc) - pnpm 8+
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your values
# Run development server
pnpm devOpen http://localhost:3000 with your browser to see the result.
-
Verify Environment Variables
# Check all required env vars are set pnpm tsx scripts/ci-verify-env.ts -
Required Environment Variables in Vercel
Public Variables (NEXT_PUBLIC_*):
NEXT_PUBLIC_SUPABASE_URL- Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Supabase anonymous keyNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY- Clerk publishable keyNEXT_PUBLIC_SITE_URL- Production URL (https://duomigo.com)
Server Variables:
SUPABASE_SERVICE_ROLE_KEY- Supabase service role key (keep secret!)CLERK_SECRET_KEY- Clerk secret key (keep secret!)
-
Clerk Configuration
- Add to Allowed Origins in Clerk Dashboard:
https://duomigo.comhttps://www.duomigo.com(if not redirecting)
- Set up webhooks if needed
- Verify OAuth providers are configured
- Add to Allowed Origins in Clerk Dashboard:
-
Pre-deployment Checks
# Run type checking pnpm typecheck # Run linting pnpm lint # Test production build locally pnpm build pnpm start
-
Test Critical Paths
- Sign up flow works
- Sign in flow works
- Practice sessions load and complete
- Audio recording works
- Feedback is displayed correctly
- Supabase data operations work
-
Push to GitHub
git add . git commit -m "Release: <version>" git push origin main
-
Vercel Deployment
- Auto-deploys on push to main branch
- Or manually trigger: Vercel Dashboard → Deployments → Redeploy
-
Post-deployment Verification
- Visit https://duomigo.com
- Check browser console for errors
- Test authentication flows
- Verify SSL certificate is valid
- Check that www redirects to apex domain
Build Fails on Vercel:
- Check build logs in Vercel Dashboard
- Verify all env vars are set in Vercel
- Run
pnpm tsx scripts/ci-verify-env.tslocally - Check Node version matches
.nvmrc
TypeScript Errors:
- For type issues with Supabase, regenerate types:
pnpm supabase gen types typescript --project-id <your-project-id> > src/types/supabase.ts
Environment Variable Issues:
- Production builds fail on missing env vars
- Preview builds only warn (won't fail)
- Use Vercel CLI to debug:
vercel env pull
src/
├── app/ # Next.js app directory
├── components/ # React components
├── lib/ # Utilities and configs
│ ├── env.ts # Client env vars
│ ├── env.server.ts # Server env vars
│ └── supabase/ # Supabase clients
├── hooks/ # Custom React hooks
└── types/ # TypeScript types
scripts/
├── ci-verify-env.ts # Environment checker
└── seed-questions.ts # Database seeder
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm typecheck- Run TypeScript compilerpnpm test- Run Playwright tests
The easiest way to deploy is via Vercel:
- Import your GitHub repository
- Set environment variables
- Deploy!
Check out the Next.js deployment documentation for more details.