[Your SaaS Name]
[One-line description of what your app does. Replace this on day one.]
Source of truth
Production on Vercel. vercel pull before any local work to mirror env + branch state.
Tech stack
Next.js 16 (App Router) + React 19 + Tailwind v4. Server Actions for every mutation. Postgres via Vercel Postgres (Neon underneath). Magic-link auth (Resend + signed JWT cookie). Stripe Checkout + Billing Portal for subscriptions. Vercel for hosting + cron.
Deploy
git push to main triggers Vercel auto-deploy. Preview URLs per PR. Production gated by manual promote on Vercel dashboard until you trust your CI.
File map
app/Next.js routesapp/(marketing)/public:/,/pricing,/privacy,/termsapp/(app)/authed:/dashboard,/settings,/billingapp/api/auth/[...]/route.tsmagic-link send + verifyapp/api/stripe/webhook/route.tsStripe webhook receiverlib/db.tsPostgres client + typed query helperslib/auth.tsJWT cookie sign/verifylib/stripe.tsStripe SDK config + price cachedb/schema.sqlinitial schemacomponents/React components, server-first
.env keys
DATABASE_URLVercel Postgres connection stringJWT_SECRETrandom 32-byte hexRESEND_API_KEYRESEND_FROM_EMAILverified sender (hello@yourdomain.com)STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETSTRIPE_PRICE_IDyour default plan price IDNEXT_PUBLIC_SITE_URLhttps://yourdomain.com
Hard rules
- Mutations are Server Actions, never API routes (except Stripe webhook).
- All Postgres queries go through
lib/db.ts. No rawpgin components. - JWT cookie is
httpOnly,secure,sameSite: 'lax'. Never read on the client. - Stripe webhook signature is verified before any DB write.
- Pricing page reads from Stripe API at build time. No hardcoded prices in JSX.
- No em-dashes anywhere in user-facing copy (Pangram flags them).
- Run a real Lighthouse pass on every customer-facing route before DNS attach.
Recent significant changes
- 2026-05-15: Scaffolded. Locked: Next 16, Tailwind v4, Resend for magic links (not NextAuth, which got bloated), Vercel Postgres (not Supabase, billing simpler).
Next session: start here
- Create Vercel project. Link Vercel Postgres.
- Create Stripe products + prices for your plans. Save
STRIPE_PRICE_ID. - Set verified domain in Resend, save
RESEND_FROM_EMAIL. - Copy
.env.example->.env.local. Fill in. - Apply
db/schema.sqlviavercel postgres connect. npm run dev. Test the magic-link sign-in end to end.- Test the Stripe webhook via
stripe listen --forward-to localhost:3000/api/stripe/webhook. - Smoke-test a real subscribe -> webhook -> DB write before launch. Critical-flow gate.