SaaS

SaaS database schema with Prisma

The Prisma user model in the Complete SaaS Starter Kit: identity, plan, and the two Stripe ids the webhook writes.

1 min read

A first SaaS schema has to answer three questions: who the person is, which plan they are on, and which Stripe objects belong to them. The Complete SaaS Starter Kit keeps that in one User model on PostgreSQL.

model User {
  id                   String   @id @default(cuid())
  email                String   @unique
  passwordHash         String
  name                 String
  plan                 String   @default("free")
  stripeCustomerId     String?  @unique
  stripeSubscriptionId String?
  createdAt            DateTime @default(now())
}

plan defaults to "free". stripeCustomerId is unique so a second Checkout cannot attach a different customer to the same user by accident. stripeSubscriptionId is how customer.subscription.updated finds the row.

There is no organization table and no membership table. One row is one account. If you later need teams, add them beside this model. Do not overload plan to mean both billing and permissions.

The Next.js SaaS Boilerplate uses the same columns on SQLite. The subscription schema page is the Stripe-only view of these fields. Product shape is in building a SaaS with Next.js, Stripe, and PostgreSQL.

Product updates for developers shipping with Designyff kits.

Purchased source may be used in personal, commercial, and client projects. Do not redistribute or resell the original source. Terms of Service

Designyff © 2026 | Starter kits for developers | Powered by  Tacko