Installation
Get from a fresh clone to a running dev server.
Before you start
Install dependencies
npm installCreate your env file
cp .env.example .env.localFill in the values. See Environment variables for what each one is and where to get it. The app validates env at startup, so a missing variable fails fast with a clear message.
Run the database migration
Apply supabase/migrations/0001_initial_schema.sql to your Supabase project, via the dashboard SQL editor or the Supabase CLI. It creates every table, RLS policy and trigger.
supabase db pushStart the dev server
npm run devOpen http://localhost:3000. Without Mailgun credentials, magic-link sign-in URLs are printed to your terminal instead of emailed, so you can test auth locally before configuring email.
Optional services degrade gracefully
Project structure at a glance
app/ Next.js App Router (pages, API routes, admin)
components/ UI component library (shadcn/ui based)
libs/ auth, supabase, stripe, mailer, security, config
models/ Zod schemas (user, subscription, payment, blogPost)
supabase/ SQL migrations
tests/ unit, integration and E2E testsFor the full tour, see Project structure.
Useful scripts
npm run dev # dev server (Turbopack)
npm run build # production build
npm run lint # ESLint
npm run test:unit # unit tests
npm run test:e2e # Playwright E2E
npm run devtool # interactive dev tool