Stack Guide · Checklists · Prompt ·
The Exact Stack I'd Use In 2027

SaaS Tech Stack

You don't need complicated infrastructure to build a serious software company. I've spent 20 years building software and built two seven-figure software companies. This is exactly what I'd use if I started again tomorrow: proven tools, no Kubernetes, and a foundation that won't fall over when the product takes off.

How To Use This Page

Starting today? Read The Stack, then follow Setup or paste The Prompt into Claude Code. Already built something? Go straight to the Checklists.

26
Decisions, Made
0
Kubernetes Clusters
90
Days Until Staging
Before You Build

Pick The Stack In An Afternoon.

Then stop. A month spent comparing databases is Building Theater: it feels like progress and nobody pays you for it. Take this list, start building, and spend the time you saved finding customers.

The Solo Founder Lab · Opening Soon

I'm building a place where you learn to build products that work like a real company's on your own, and get them in front of people who pay, with a CTO who's built two seven-figure software companies in your corner.

Lab.exeWaitlist Open

Less Debate. More Shipping.

  • Live product teardowns. Your app, your landing page and your architecture, reviewed in front of everyone.
  • Weekly CTO office hours. Live, hot-seat style. Bring the Stripe webhook that won't fire.
  • Launch Pad. When you launch, the room shows up.
  • The 30-Day Launch Plan. Validate, plan, build and launch, one week at a time. Members only.

Free to join the waitlist. Opens at $49/mo, and the price goes up as seats fill, so first in pays the least.

The Rules

Simple Tech. Real Customers.

Every pick on this page follows seven rules. When a new tool comes along, run it through these before you touch your stack.

Rule 01

Build the business, not the infrastructure.

Your biggest problem is finding customers. Don't spend six months on an engineering platform before anyone has said they want the product.

Rule 02

Pick proven technology.

Boring, established tools that developers know and AI coding tools write well. Don't experiment with your company's foundation because a framework is trending.

Rule 03

Scale with money before complexity.

A bigger database plan is usually far cheaper than weeks spent adding distributed infrastructure. Pay first. Re-architect when paying stops working.

Rule 04

Working isn't the same as secure.

AI can build something that looks great and works, with serious holes underneath. Security needs deliberate attention, every time.

Rule 05

Visibility is part of the business.

Analytics tell you what customers do. Monitoring tells you what the app does. Without both, you're flying blind.

Rule 06

A backup is worthless until you've restored it.

Protect customer data, then prove you can get it back. A backup you've never restored is a hope, not a plan.

Rule 07

The goal is customers, not perfect architecture.

Make a handful of good decisions, avoid a few expensive mistakes, ship, and start selling.

The Map

How It All Fits Together.

One Next.js app on Vercel does almost everything. It talks to a handful of managed services. The only thing that runs outside Vercel is the worker that processes background jobs, and you won't need it on day one.

The Stack

Every Pick, One Table.

Here's the whole list. Where there's a second option, it's for a specific situation, not because I can't decide. Each section below explains why.

LayerPickWhat it doesDocs
01 · Core App
LanguageTypeScriptJavaScript with types, front end to back end.typescriptlang.org
Front endReactBuilds the screens your customers use.react.dev
Framework + APINext.jsPages and API routes in one project. No separate backend.nextjs.org/docs
MobileReact NativeiOS and Android from one codebase, when you need an app.reactnative.dev
HostingVercelDeploys every push. Preview link for every branch.vercel.com/docs
02 · Data And Auth
DatabaseSupabase PostgresManaged Postgres, plus auth and backups in one place.supabase.com/docs
Budget pickNeonPostgres that scales to zero, when cost matters most.neon.com/docs
ORMPrisma 7Typed queries, schema and migrations.prisma.io/docs
AuthSupabase AuthSign-up, login, password resets, sessions.supabase.com/docs/guides/auth
03 · Money, Files And Messages
PaymentsStripeCheckout, subscriptions, invoices, billing portal.docs.stripe.com/billing
FilesAmazon S3Stores uploads. Private by default.docs.aws.amazon.com/s3
CDNCloudFront or CloudflareServes files fast, close to the customer.CloudFront · Cloudflare
EmailSendGridEmails your app sends: receipts, resets, alerts.twilio.com/docs/sendgrid
SMSTwilioText messages and codes.twilio.com/docs/messaging
04 · AI
AI codingConductor + Claude CodeSeveral coding agents at once, each on its own branch.conductor.build · Claude Code
Agent skillsMatt Pocock's SkillsA senior engineer's workflow, as skills your agent follows.github.com/mattpocock/skills
ModelsAnthropic, OpenAI for writingClaude for most things. OpenAI when the job is writing.Anthropic · OpenAI
AI in your appVercel AI SDKOne way to call any model, with streaming and tools.ai-sdk.dev
05 · Jobs And Scale
ScheduledVercel CronCalls a route on a schedule.vercel.com/docs/cron-jobs
QueueBullMQ, or SQS on AWSBackground work with retries.docs.bullmq.io · SQS
CacheRedis, when you need itSaves repeated work. Usually not yet.redis.io/docs
06 · Visibility
AnalyticsPostHogWhat customers actually do in the product.posthog.com/docs
MonitoringDatadogErrors, slow routes, alerts, log search.docs.datadoghq.com
LogsStructured JSONEvery log line searchable by customer and request.docs.datadoghq.com/logs
07 · Security
Security reviewCloudflare's security-audit skillHas your agent audit the code before you ship.github.com/cloudflare/security-audit-skill
DNS + protectionCloudflareDNS, proxy, rate limits, attack protection.developers.cloudflare.com/dns
01 · Core App

One Language. One App. One Host.

The less you have to run, the more time you spend selling. TypeScript on Next.js, deployed to Vercel, covers the web app and its backend in a single project.

TypeScriptLanguage

Catch mistakes before customers do.

JavaScript with types. If a function expects an invoice and gets a user, the editor tells you before anything ships.

Why
One language front to back, a huge library ecosystem, and every AI coding tool writes it well. Types also catch the agent's mistakes.
Tip
Turn on "strict": true on day one. Turning it on later means fixing hundreds of errors at once.
ReactFront End

No reason to get fancy.

React builds the screens. It's mature, everyone knows it, and every component library and tutorial assumes it.

Why
When you're getting a business off the ground, the front-end framework is the last place to take a risk.
Skip
Switching frameworks because one is trending. Nobody buys your product because of its framework.
Next.jsApp + API

Your backend lives in the same project.

Next.js serves your pages and your API routes. A route is a file: app/api/invoices/route.ts answers /api/invoices.

Why
One repo, one deploy, one set of types shared between screen and server. Don't build a separate backend service until you actually need one.
Note
Next.js 16 renamed middleware.ts to proxy.ts. Older tutorials still use the old name.
React NativeMobile

One codebase for iOS and Android.

If you need a phone app, build it in React Native. Your team already knows React, and the app calls the same Next.js API routes as the website.

Why
Two native apps means two codebases, two skill sets and every feature built twice. You don't have time for that.
Ask
Does it need to be an app? A web app that works well on a phone is often enough for version one.
VercelHosting

Push to GitHub. It's live.

Connect your repo and every push deploys. Each branch gets its own preview link, and your secrets live in its environment variables.

Why
It's made by the Next.js team, so there's nothing to configure. You build the business instead of running servers.
Tip
Use separate environment variables for Production, Preview and Development, so a preview can never touch production data.
Start.Here
# A Next.js app with TypeScript,
# the App Router and ESLint
npx create-next-app@latest my-saas

cd my-saas
npm run dev
# open http://localhost:3000

# Then push to GitHub and import
# the repo at vercel.com/new
Strong Opinion

Express is dated.

Express used to be a great default for a Node.js backend. Today there are better choices. Next.js API routes give you the backend with none of the extra service to deploy, secure and keep in sync with your front end.

Strong Opinion

No Docker. No Kubernetes.

Kubernetes is for companies with engineering teams and money to set on fire. As a solo founder, don't create an infrastructure job for yourself before you have a single customer.

02 · Data And Auth

Postgres, Prisma, And A Login That Stays Up.

Postgres can carry a serious SaaS business for years. Supabase runs it for you and adds logins and backups. Prisma gives your code a typed way to talk to it.

SupabaseDatabase

Managed Postgres, plus the extras.

A real Postgres database you don't have to run, with auth, backups and point-in-time recovery in the same dashboard.

Why
Postgres is proven. Supabase takes the operations off your plate and gives you the other services you'll need in one place.
Setup
Two projects from day one: one for development, one for production.
NeonBudget Pick

When every dollar counts.

Also Postgres. It scales to zero when nobody's using it, so a quiet app costs very little. Branches give you a copy of the database in seconds.

When
Keeping costs down matters more than having auth and storage in the same product. Pair it with Supabase Auth, or keep Supabase for auth only.
Same
Prisma works the same way. Only the connection strings change.
Supabase AuthLogins

If users can't log in, you have no product.

Sign-up, login, magic links, social logins, password resets and sessions, in the same project as your database.

Why
Auth is foundational. I want it boring, reliable and close to my data.
Skip
Clerk. I've had concerns about its uptime and reliability, and I won't make login a point of failure for my business.
Prisma.Setup
# Pin Prisma 7. Plain "npm i prisma" now installs
# the Prisma 8 release candidate, which has no
# migrate command yet.
npm i -D prisma@7 dotenv
npm i @prisma/client@7 @prisma/adapter-pg@7 pg
npx prisma init --output ../generated/prisma

# .env (never commit it)
# DATABASE_URL: Supabase "Transaction pooler", port 6543.
#   The app uses this one.
# DIRECT_URL: Supabase "Direct connection", port 5432.
#   Migrations use this one. If your network can't reach
#   it, use the "Session pooler" string instead.

# Every time you change schema.prisma:
npx prisma migrate dev --name add_invoices
npx prisma generate

# In production: apply migrations, never create them
npx prisma migrate deploy
prisma.config.ts
import "dotenv/config";
import { defineConfig, env } from "prisma/config";

export default defineConfig({
  schema: "prisma/schema.prisma",
  migrations: { path: "prisma/migrations" },
  // The CLI (migrations) uses the direct connection.
  datasource: { url: env("DIRECT_URL") },
});
schema.prisma
generator client {
  provider = "prisma-client"
  output   = "../generated/prisma"
}

datasource db {
  provider = "postgresql"
}

// Every customer record belongs to an organization.
// That's what you'll filter on, and log on.
model Organization {
  id               String       @id @default(uuid())
  name             String
  stripeCustomerId String?      @unique
  members          Membership[]
  createdAt        DateTime     @default(now())
}

model Membership {
  id     String       @id @default(uuid())
  userId String       // the Supabase Auth user id
  orgId  String
  role   String       @default("member")
  org    Organization @relation(fields: [orgId], references: [id])

  @@unique([userId, orgId])
}
lib/db.ts
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaPg } from "@prisma/adapter-pg";

// One client per server, reused across hot reloads.
const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL!,
});
const g = globalThis as unknown as { prisma?: PrismaClient };

export const prisma = g.prisma ?? new PrismaClient({ adapter });
if (process.env.NODE_ENV !== "production") g.prisma = prisma;
Auth.Setup
npm i @supabase/supabase-js @supabase/ssr

# .env.local
# NEXT_PUBLIC_SUPABASE_URL=https://xyz.supabase.co
# NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_...
# SUPABASE_SECRET_KEY=sb_secret_...  (server only!)

# Then copy proxy.ts from Supabase's Next.js guide.
# It refreshes the login cookie on every request.

Start from Supabase's Next.js server-side auth guide. It has the browser client, the server client and the proxy.ts file.

app/api/orgs/route.ts
import { createClient } from "@/lib/supabase/server";
import { prisma } from "@/lib/db";

export async function GET() {
  // 1. Who is this? getClaims() checks the token.
  //    Never trust getSession() on the server.
  const supabase = await createClient();
  const { data } = await supabase.auth.getClaims();
  const userId = data?.claims.sub;
  if (!userId) return Response.json({ error: "Unauthorized" }, { status: 401 });

  // 2. What can they see? Only their own orgs.
  const orgs = await prisma.organization.findMany({
    where: { members: { some: { userId } } },
  });
  return Response.json(orgs);
}
Read This Twice

Prisma skips Supabase's row rules.

Prisma connects as a database owner, so Row Level Security doesn't apply to it. That means every query has to filter by the logged-in user's organization in your code. Keep RLS turned on anyway, with no policies, so nobody can read your tables straight from the browser with the publishable key.

Keys

Publishable is public. Secret is not.

The publishable key is meant for the browser. The secret key skips every rule, so it lives only in server environment variables. Never in a variable that starts with NEXT_PUBLIC_.

Auth Email

Plug SendGrid into Supabase Auth.

Supabase's built-in email sender is for testing and has tight limits. Before launch, set SendGrid as the custom SMTP server so sign-up and reset emails actually arrive.

03 · Money, Files And Messages

Don't Build What You Can Rent.

Billing, file storage, email and texts are solved problems. Use the mature platform for each one and get back to the part of the product only you can build.

StripePayments

Never build your own billing.

Stripe Checkout takes the payment. Stripe Billing runs the subscription. The Customer Portal lets customers change cards, plans and cancel without emailing you.

Store
The Stripe customer id on your organization, and the subscription status your webhook last saw.
Truth
Webhooks decide who has paid, not the success page. People close tabs.
Amazon S3Files

Cheap, proven, private.

Every upload goes to S3. Turn on Block Public Access for the whole AWS account, and only make something public when there's a clear reason.

Upload
Your API hands the browser a presigned URL that works for a few minutes. The file goes straight to S3, never through your server.
Read
Private files get short-lived presigned links. Never a public bucket.
CloudFront / CloudflareCDN

Storage holds it. A CDN delivers it.

A CDN keeps copies of your files on servers near your customers, so they load fast and S3 isn't hit every time.

AWS
CloudFront in front of S3 with Origin Access Control, so the bucket stays private and only CloudFront can read it. Use signed URLs for private files.
Or
Cloudflare, which you already have for DNS. Either is fine.
SendGridEmail

The emails your app sends.

Receipts, password resets, invites and alerts. Not newsletters: keep marketing email on a separate tool and domain so a bad campaign can't hurt your password resets.

First
Authenticate your domain (SPF and DKIM) and add a DMARC record. Without them, your emails go to spam.
TwilioSMS

Texts and codes.

Appointment reminders, alerts and verification codes. One API, and it's the same company as SendGrid.

US
Texting US numbers from a regular number needs A2P 10DLC registration, and approval can take weeks. Start it early.
Cap
Rate-limit any route that sends a text. Bots love free SMS.
Stripe.Webhook
// app/api/stripe/webhook/route.ts
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);

export async function POST(req: Request) {
  let event: Stripe.Event;
  try {
    // Prove it came from Stripe.
    event = stripe.webhooks.constructEvent(
      await req.text(),
      req.headers.get("stripe-signature")!,
      process.env.STRIPE_WEBHOOK_SECRET!,
    );
  } catch {
    return new Response("Bad signature", { status: 400 });
  }
  // checkout.session.completed,
  // customer.subscription.updated / .deleted,
  // invoice.payment_failed: update the org.
  return new Response("ok");
}
04 · AI

AI To Build It. AI Inside It.

Two different jobs. Conductor, Claude Code and good skills help you write the product. Anthropic, OpenAI and the AI SDK power the AI features your customers use.

Conductor + Claude CodeHow I Build

Several agents, each on its own branch.

Claude Code is the agent that writes the code. Conductor runs several Claude Code agents side by side, each in its own workspace: a separate copy of your repo on its own branch, so they never trip over each other.

  1. Write a CLAUDE.md. In the repo root: the stack, the commands, and your rules ("every API route checks the user and their org"). Every agent reads it first.
  2. One task per workspace. "Add Stripe Checkout" or "fix the invite email". Small, specific, done in an hour.
  3. Plan, then build. Ask for the plan first. Fix the plan, not the code.
  4. Review the diff. Read what changed, run it, ask for fixes in the same workspace.
  5. Ship it. Open a pull request from the workspace, merge, archive the workspace.
Tip
Run two or three at once on unrelated parts of the app. Two agents in the same files means merge conflicts.
Matt Pocock's SkillsWorkflow

Teach your agent to work like a senior engineer.

A skill is a short instruction file your agent follows for one kind of job. Matt Pocock's set covers the parts AI skips when left alone: being questioned about your plan until it's solid (grill-me), building test-first in small slices (tdd), and turning a plan into tickets.

# Copies the skills into your repo. You pick
# which ones, and can edit them.
npx skills@latest add mattpocock/skills

# Then, once, inside Claude Code:
/setup-matt-pocock-skills
Why
They're plain files in your repo, so you can read exactly what the agent will do and change it. The repo's README has the current list.
Anthropic + OpenAIModels

Pick the model by the job.

Coding
Anthropic. Claude through Claude Code.
Features
Anthropic by default: summaries, extraction, classification, agents, anything that has to follow instructions.
Writing
OpenAI. When the output is prose a person reads, like a draft email or marketing copy, it's my preference.

Keep the model name in config, not scattered through code. Then switching is a one-line change.

Vercel AI SDK
// npm i ai @ai-sdk/anthropic @ai-sdk/openai
import { generateText } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
import { openai } from "@ai-sdk/openai";

// Most features: Anthropic.
const { text: summary } = await generateText({
  model: anthropic(process.env.AI_MODEL_DEFAULT!),
  prompt: `Summarize this ticket: ${ticket}`,
});

// Writing features: OpenAI. Same code, other model.
const { text: draft } = await generateText({
  model: openai(process.env.AI_MODEL_WRITING!),
  prompt: `Draft a friendly reply to: ${ticket}`,
});

One API for every provider, plus streaming, structured output and tool calls. You build your feature, not model plumbing.

05 · Jobs And Scale

Scale With Dollars First.

Scheduled jobs run on a clock. Background jobs run because something happened. They're different tools. And before you add a cache, try paying for a bigger database.

Vercel CronOn A Clock

"Every morning at 9."

Vercel calls one of your API routes on a schedule. Good for daily digests, nightly cleanups and syncs that finish within the function's time limit.

// vercel.json
{ "crons": [{
  "path": "/api/cron/daily-digest",
  "schedule": "0 9 * * *"
}] }

// In the route: reject anything without
// Authorization: Bearer $CRON_SECRET
Note
Cron runs on production deployments only.
BullMQWhen Something Happens

"Do this soon, and retry if it fails."

A customer uploads 500 rows to import. Don't make them wait. The API route adds a job to a queue and answers right away. A worker picks it up, and retries if it fails.

import { Queue } from "bullmq";
import IORedis from "ioredis";

const connection = new IORedis(process.env.REDIS_URL!,
  { maxRetriesPerRequest: null });
const imports = new Queue("imports", { connection });

await imports.add("csv", { orgId, fileKey },
  { attempts: 5,
    backoff: { type: "exponential", delay: 10_000 } });
Runs
BullMQ needs Redis and a worker that stays running. Vercel functions don't stay running, so the worker lives on a small always-on server.
AWS SQSAWS Shops

If you're already deep in AWS.

SQS is Amazon's managed queue. If your app already runs a lot of AWS infrastructure, it's an excellent choice, and there's no Redis to look after.

Pick
BullMQ by default. SQS when AWS is already home.
Either
Make every job safe to run twice. Queues retry, and sometimes deliver the same job again.
Redis · When It Pays

Cache what's slow and repeated.

An expensive dashboard query hit hundreds of times a minute. An outside API that rate-limits you. AI answers to the same question. That's when Redis earns its place.

Redis · When It Doesn't

Not because "serious apps have a cache".

A cache is a second copy of your data that can be wrong. It adds bugs and a service to run. You can go a very long time without it.

Scale With Dollars

Try these before new architecture.

Add the missing database index. Move to a bigger database plan. Fix the query that loads 10,000 rows to show 20. Then measure again. Most "we need Redis" problems end here.

06 · Visibility

Don't Find Out From An Angry Customer.

PostHog shows you what customers do. Datadog shows you what the app does. Structured logs tie the two together, so you can see exactly what happened to one customer in one request.

PostHogAnalytics

Measure behavior, not sign-ups.

Sign-ups are a vanity number. PostHog shows which features people use, the path they take, and where they give up.

Track
Feature adoption, user journeys, conversion funnels (sign-up, first real use, paid), and where people abandon the workflows that matter.
Tip
Identify users after login, and group them by organization, so you can see accounts, not just people.
DatadogMonitoring

Know before the phone rings.

Errors, slow routes, failed jobs and log search in one place, with alerts that reach you before a customer does.

Alert
A rise in 500 errors, failed payment webhooks, failed background jobs, and a route suddenly getting slow.
Logs
Send Vercel's logs to Datadog with Datadog's Vercel integration.
lib/log.ts
// One JSON object per line.
// Datadog makes every key a filter.
type Fields = Record<string, unknown>;

export function log(
  level: "info" | "warn" | "error",
  msg: string,
  fields: Fields = {},
) {
  console.log(JSON.stringify({
    ts: new Date().toISOString(),
    level,
    msg,
    env: process.env.VERCEL_ENV,
    ...fields,
  }));
}
One.Log.LineShown Pretty
{
  "ts": "2026-11-08T14:03:22.418Z",
  "level": "error",
  "env": "production",
  "msg": "Invoice email failed",
  "requestId": "req_8f2c41",      // on every line of this request
  "correlationId": "job_77a1e0",  // follows the work into the queue
  "userId": "u_41b9d2",
  "orgId": "org_9a7c13",
  "route": "POST /api/invoices/send",
  "op": "invoice.send",
  "invoiceId": "inv_22013",
  "status": 502,
  "durationMs": 1834,
  "error": { "code": "EMAIL_TIMEOUT", "message": "SendGrid timed out" }
}

With lines like this, "why did Acme's invoice fail yesterday?" is one search: @orgId:org_9a7c13 @op:invoice.send status:error. Without them, it's an afternoon of guessing.

Log Every Time

Who, where, what, how long.

Request id and correlation id. Timestamp and environment. User id and organization id. Route and operation. The ids of the business objects involved. Response status, duration, and the error code and details when it fails.

Never Log

Secrets and card numbers.

No passwords, auth tokens, API keys, payment details or anything sensitive a customer typed in. Log the id of the thing, not the thing.

Day One

Start structured, stay structured.

Adding context to a thousand console.log("here") calls later is miserable. Put the logger in on day one and tell your agent to use it in CLAUDE.md.

07 · Security

AI Writes Holes Fast, Too.

AI can generate working software incredibly quickly. That includes working software with serious security holes. These are the ones that show up most in apps built in a hurry.

Private By Default

Buckets and databases.

No public S3 buckets. RLS on for every Supabase table, so the publishable key can't read anything. Check from a logged-out browser, not by reading the code.

Untrusted Input

Everything a user sends is suspect.

Form fields, query strings, headers, uploaded file names, webhook bodies. Check the type, the length and the allowed values on the server, every time. A check in the browser is a convenience, not security.

SQL Injection

Never build queries out of strings.

Prisma's normal queries are safe. If you need raw SQL, use the $queryRaw template form, which escapes values for you. Never pass user input to $queryRawUnsafe.

XSS

Text that turns into code.

If a customer puts a script in their name and you render it as HTML, it runs in the browser of everyone who views it. React escapes text for you. dangerouslySetInnerHTML turns that off, so only use it on HTML you've cleaned.

Authentication

Check the token on the server.

Every API route checks who's calling with getClaims(). Webhooks from Stripe and Twilio check their signatures. A hidden button is not a lock.

Authorization

Then check what they're allowed to touch.

Being logged in doesn't mean invoice 1043 is yours. Every query filters by the caller's organization, on the server. Test it: log in as customer A and request customer B's record by id.

Cloudflare security-audit

Run it before you ship.

Cloudflare's open-source skill turns your coding agent into a structured security auditor. It works through the code in phases, checks its own findings, and writes up what it found.

# Needs Node.js 22.20 or newer
npx skills add https://github.com/cloudflare/security-audit-skill --skill security-audit

# Then in Claude Code:
/security-audit
Then
Fix the criticals, run it again, and repeat before every big release.
CloudflareDNS + Shield

Put your domain behind Cloudflare.

Manage DNS there. Proxy your traffic through it and you get protection from network attacks, plus rate limiting rules you can switch on in minutes.

Limit
Login, sign-up, password reset, anything that sends a text, and every AI route.
Also
It can be your CDN, too.

Want the full list of holes? Work through my Security Checklist: 15 checks, each with a test you can run.

Abuse · Before Traction

Don't overbuild it.

Elaborate abuse protection for a product nobody uses yet is wasted time. B2C apps need more attention once usage grows, because strangers will try things your business customers won't.

Abuse · The Minimum

Spending limits on everything metered.

Set monthly limits in the Anthropic and OpenAI consoles, spend alerts in Vercel and AWS Budgets, and usage alerts in Twilio. Add a per-user cap on AI calls. A viral week or one abusive user shouldn't hand you a bill bigger than your revenue.

08 · Backups And Environments

Prove You Can Get It Back.

Before your first customer, daily backups are fine. The day someone trusts you with their data, turn on point-in-time recovery. Then do the part everyone skips: restore it.

BackupsWhen

Daily, then point-in-time.

Before
No customers yet: Supabase's daily backups are acceptable. You'd lose at most a day of test data.
First $
Your first customer: turn on point-in-time recovery (PITR) in Supabase. It lets you restore to any second, like one minute before a bad migration.
Always
A backup you've never restored isn't a recovery plan.
Restore.DrillEvery Quarter
  1. Pick a time. Say, an hour ago.
  2. Restore to a new project. Supabase can restore a backup into a separate project. Never practice by restoring over production.
  3. Check it. Point a local copy of the app at it. Log in as a test customer. Compare row counts on your key tables with production.
  4. Time it. How long from "we need a restore" to "it's back"? That's your real recovery time.
  5. Write it down. Every click, in docs/restore.md, so a stressed you at 2am can follow it. Then delete the test project.
DevelopmentDay 0

Break things here.

Your laptop and Vercel preview links. Its own Supabase project, Stripe in test mode, test API keys. Nothing here can touch a real customer.

ProductionDay 0

Real customers only.

Its own Supabase project, Stripe live mode, live keys that only the production environment can see. No experiments, no test data, no "quick fix" straight in the database.

StagingBy Day 90

A dress rehearsal.

Once the business gets serious, add a third environment set up like production: its own database and domain, Stripe test mode. Changes land here first, you click through, then they go live.

Setup

From Empty Folder To Live App.

The order I'd do it in. Steps 01 to 08 are a weekend. The rest arrive when the product needs them.

Weekend.OneDay 0
  1. Accounts. GitHub, Vercel, Supabase (two projects: dev and prod), Stripe, Cloudflare, PostHog, Anthropic. Turn on two-factor login for every one.
  2. App. npx create-next-app@latest, strict TypeScript, push to GitHub, import on Vercel.
  3. Domain. Move DNS to Cloudflare and point the domain at Vercel.
  4. Database. Prisma 7 with the two Supabase connection strings. First model: Organization and Membership. Run the first migration.
  5. Auth. Supabase Auth with @supabase/ssr and proxy.ts. Sign up, log in, log out, reset password. Create an organization on sign-up.
  6. Logging. The JSON logger, used in every route from the first one.
  7. Payments. Stripe Checkout, the Customer Portal and a signed webhook that updates the organization.
  8. Analytics. PostHog, identify users after login, and spending limits on every AI key.
As.You.GrowDay 1 to 90
  1. Email. SendGrid with an authenticated domain, also plugged into Supabase Auth as its SMTP server.
  2. Files. A private S3 bucket, presigned uploads, then a CDN in front when you're serving a lot.
  3. AI features. The AI SDK with Anthropic by default and OpenAI for writing.
  4. Monitoring. Datadog with your Vercel logs and alerts on errors and failed webhooks.
  5. Security. Run the security-audit skill and the checklist before the first real customer's data goes in.
  6. Backups. PITR on with your first customer. Restore drill in the first month.
  7. Jobs. Vercel Cron for schedules. BullMQ and a worker the first time a request does slow work.
  8. Staging. A third environment by Day 90.
The Prompt

Have Claude Code Lay The Foundation.

Make an empty folder, open Claude Code in it, and paste this. It builds Weekend One step by step, stops whenever you need to click something in a dashboard, and shows you each piece working before it moves on.

Stack.Starter.Prompt
You're helping me start a SaaS product: [one sentence on what it does and who pays for it]. I'm [not an engineer / a developer], so explain each step in plain words before you do it.

The stack. Don't add or swap anything without asking:
- TypeScript (strict) and Next.js with the App Router. API routes are the backend; no separate server, no Express, no Docker.
- Vercel for hosting, deployed from GitHub.
- Supabase Postgres, with separate dev and prod projects.
- Prisma 7, pinned: prisma@7, @prisma/client@7, @prisma/adapter-pg@7 and pg. Not Prisma 8. prisma.config.ts uses DIRECT_URL for migrations; the app uses DATABASE_URL (the transaction pooler) through the pg adapter.
- Supabase Auth with @supabase/ssr and proxy.ts. Use getClaims() on the server, never getSession().
- Stripe Checkout, Billing and the Customer Portal.
- PostHog for product analytics.

Build it in this order. After each step, show me it working and wait for my OK.

1. App. create-next-app, strict TypeScript, a CLAUDE.md that records this stack and these rules.
2. Logger. lib/log.ts writes one JSON object per line: ts, level, msg, env, plus fields. Every route logs requestId, userId, orgId, route, op, status and durationMs. Never log passwords, tokens or payment details.
3. Database. Organization (id, name, stripeCustomerId, subscriptionStatus, createdAt) and Membership (userId, orgId, role). First migration. Turn on RLS for every table with no policies, since all access goes through Prisma on the server.
4. Auth. Sign up, log in, log out, reset password. Create an Organization and an owner Membership on sign-up. A /app area only logged-in users can see.
5. Rule for every API route: check the user with getClaims(), then filter every query by an organization they belong to. Write a test that proves user A can't read user B's organization.
6. Billing. Stripe Checkout for [$X/month], the Customer Portal, and POST /api/stripe/webhook that verifies the signature and updates subscriptionStatus. The webhook is the source of truth, not the success page.
7. Analytics. PostHog, identifying the user after login and grouping by organization. Track sign_up, [the one action that means they got value] and subscribed.

Rules:
- Never print or commit secrets. Read them from .env.local and give me the list of variables to add on Vercel myself, per environment.
- Validate every input on the server. No string-built SQL. No dangerouslySetInnerHTML on user content.
- Before each step, tell me the plan in 3 to 5 bullets and wait.
- When something needs me (Supabase, Stripe, Vercel or Cloudflare dashboards), tell me exactly where to click.
Pink Means Edit Me

Fill in what you're building, your price and the action that means value. Leave the rest.

Accounts First

Make the accounts in Step 01 before you paste this. Your agent can't sign up for things for you.

Then Audit

When it's done, run Cloudflare's /security-audit and the Security Checklist below before a real customer signs up.

Checklists

Before Real Data. Before Launch.

Two lists. Do the first before any real customer data touches your database. Do the second before you tell the world.

Security.Check12

Before you accept customer data.

  • S3 Block Public Access is on for the whole AWS account.
  • RLS is on for every Supabase table. The publishable key reads nothing from a logged-out browser.
  • Every API route checks the user with getClaims().
  • Every query filters by the caller's organization. Tested: user A can't load user B's record by id.
  • No secret keys in NEXT_PUBLIC_ variables, the browser bundle or the repo.
  • Every input is validated on the server: type, length, allowed values.
  • No string-built SQL. No $queryRawUnsafe with user input.
  • No dangerouslySetInnerHTML on anything a user typed.
  • Stripe and Twilio webhooks verify their signatures.
  • Cloudflare rate limits on login, sign-up, reset, SMS and AI routes.
  • Logs contain ids, never passwords, tokens or card details.
  • Cloudflare's /security-audit has run, and every critical is fixed.
Launch.Check14

The minimum to go live.

  • Domain on Cloudflare DNS, HTTPS working, proxied.
  • Production has its own Vercel variables and its own Supabase project.
  • Migrations applied with prisma migrate deploy.
  • Supabase Auth Site URL and redirect URLs set to the real domain.
  • Supabase Auth sends through SendGrid, and a reset email lands in the inbox, not spam.
  • SendGrid domain authenticated, with a DMARC record.
  • Stripe live keys and a live webhook endpoint. One real purchase made and refunded.
  • Customer Portal on, so customers can update a card or cancel.
  • Twilio US texting registered (A2P 10DLC), if you text US numbers.
  • PostHog sees sign-ups, and a funnel from sign-up to paid exists.
  • Datadog has the logs, and alerts on errors and failed webhooks.
  • Spending limits on every AI key, plus Vercel and AWS spend alerts.
  • Backups on. PITR on the moment you have a customer. One restore tested.
  • The security checklist, all 12.
Roadmap

Day 0. Day 30. Day 90.

Not everything on this page belongs in week one. Here's what to do now, and what can wait until the business asks for it.

Day 0Build And Sell

The foundation.

  • TypeScript, Next.js, Vercel
  • Supabase database and auth, through Prisma 7
  • Dev and production, kept apart
  • Stripe Checkout and webhooks
  • Cloudflare DNS
  • JSON logging in every route
  • PostHog
  • Spending limits on AI keys
  • Daily backups
  • Conductor, Claude Code, Matt Pocock's skills
Day 30First Customers

Protect what they trust you with.

  • Security checklist and /security-audit, before real data
  • PITR on with the first customer
  • First restore drill, written down
  • Datadog alerts
  • SendGrid with an authenticated domain
  • Cloudflare rate limits
  • S3 for uploads, if you have them
  • PostHog funnels: where do people give up?
  • Vercel Cron for anything scheduled
Day 90Getting Serious

Room to grow.

  • Staging environment
  • BullMQ and a worker, when requests do slow work
  • CDN in front of your files
  • Abuse protection, if you're B2C and growing
  • Redis, only if measurements say so
  • A bigger database plan before any re-architecture
  • React Native, if customers are asking for an app
  • Restore drill, again
Common Mistakes

The Expensive Ones I Keep Seeing.

Mistake 01

A separate backend on day one.

An Express server, a React app and a contract between them, all to serve ten users. Next.js API routes do the job in one project. Split it out when a real need shows up, not before.

Mistake 02

Kubernetes before customers.

Weeks of YAML and an infrastructure job nobody's paying you for. Vercel runs it. You sell.

Mistake 03

Building your own auth or billing.

Both look simple and are full of edge cases: resets, sessions, proration, failed cards, refunds, tax. Supabase Auth and Stripe have already hit every one.

Mistake 04

Thinking a login means the data is private.

Public buckets, tables open to the browser key, and routes that check you're logged in but not that the record is yours. Most AI-built leaks are one of these three.

Mistake 05

Adding Redis because serious apps have one.

A cache you didn't need is a second copy of your data that can be wrong. Add the index, buy the bigger plan, measure. Then decide.

Mistake 06

Backups nobody has ever restored.

You find out the backup doesn't work on the worst day of the year. Do the drill when nothing's on fire.

Mistake 07

Logs that say "error".

No user, no organization, no request id. Now a customer is on the phone and you're guessing. Structured logs from day one cost nothing.

Mistake 08

No spending limits on AI.

One loop in your code, one abusive user or one great week, and the bill arrives before the revenue does. Set the limits before launch.

Mistake 09

Testing in production.

One database for everything means one bad migration away from losing customer data. Dev and prod are separate from day zero.

Mistake 10

Debating the stack instead of selling.

The framework will never be why you fail. Not talking to customers will be. Pick this stack, ship, and spend the month you saved on sales.

One More Thing

Tools Are The Easy Part.

Anybody can build software now. Not everybody can build a business.

The Solo Founder Lab

Reading about tools is a great way to feel busy. The Lab is for Founders who'd rather get customers: weekly office hours with a CTO who's built two seven-figure software companies, and a room of other Founders who care whether anybody buys what you're making.

Lab.exe✣

Less Theater. More Customers.

Want my 30-Day Launch Plan? It's for Lab members only: validate, plan, build and launch, one week at a time.

See The Solo Founder Lab ▶