# Production checklist (PRO)

import { Callout } from "fumadocs-ui/components/callout";
import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
import { Step, Steps } from "fumadocs-ui/components/steps";
import { Badge } from "@pycolors/ui";
import {
  CheckCircle,
  CreditCard,
  Database,
  Download,
  KeyRound,
  LockKeyhole,
  Rocket,
  Server,
  ShieldCheck,
} from "lucide-react";

import { PreferAvoid } from "@/components/docs/prefer-avoid";
import { DocsDecisionGrid } from "@/components/docs/docs-decision-grid";
import { DocsFeatureGrid } from "@/components/docs/docs-feature-grid";
import { DocsLinks } from "@/components/docs/docs-links";
import { DocsUpgradeCTA } from "@/components/docs/docs-upgrade-cta";

<div className="flex flex-wrap items-center gap-2">
  <Badge variant="outline">
    Starter Pro
  </Badge>

  <Badge>
    Production
  </Badge>
</div>

## Validate the foundation before launch

Use the [automated coverage guide](/docs/starter-pro/release-readiness) to review
what is checked with synthetic data. Run `pnpm ops:diagnose`, check
`/api/readiness`, connect the [operational signals](/docs/starter-pro/operations)
to your monitoring and rehearse a verified restore before retaining customer data.
Configure your own quotas if your offer needs caps; defaults are uncapped and
billing remains personal.

Starter Pro gives you the production-shaped foundation.

This checklist helps you validate that foundation before exposing the product to real users, real payments, and real customer data.

A launch-ready SaaS should not only “build successfully”.

It should validate:

* authentication
* billing
* backend persistence
* protected routes
* secure delivery
* environment variables
* deployment behavior
* recovery paths
* buyer trust

<DocsUpgradeCTA title="Ready is when the systems agree." description="Auth identifies the user. Billing confirms the customer. Backend protects the data. Delivery completes the purchase." productSlug="starter-pro" buyLabel="Get Starter Pro" secondaryHref="/docs/starter-pro/getting-started" secondaryLabel="Setup guide" />

<Callout title="Production rule">
  Do not launch because the UI looks finished. Launch when the critical systems
  behave correctly.
</Callout>

## What this checklist covers

<DocsFeatureGrid
  columns={3}
  tone="platform"
  items={[
  {
    title: "Auth",
    description:
      "Sessions, providers, reset flows, verification, and protected routes.",
    icon: LockKeyhole,
  },
  {
    title: "Billing",
    description:
      "Checkout, portal, webhooks, invoices, subscriptions, and access.",
    icon: CreditCard,
  },
  {
    title: "Backend",
    description:
      "Database, ownership, migrations, server rules, and product data.",
    icon: Server,
  },
]}
/>

### Launch readiness model

> Production readiness is not one check.
> It is the alignment of identity, payment, data, access, and delivery.

| Layer       | Production question                                             |
| ----------- | --------------------------------------------------------------- |
| Auth        | Can real users sign in safely and recover access?               |
| Billing     | Can real customers pay and have state synchronized?             |
| Backend     | Can product data persist with ownership and access rules?       |
| Delivery    | Can paid access be fulfilled securely after purchase?           |
| Environment | Are production secrets complete and separated from local/test?  |
| Deployment  | Does the production build behave like the local validated flow? |

<Callout type="info" title="Go-live principle">
  A production checklist should verify behavior, not only configuration.
</Callout>

## Checklist

<Steps>
  <Step>
    ### Validate environment variables

    Confirm that local, preview, and production environments are separated.

    ```bash title=".env.production"
    NEXT_PUBLIC_APP_URL=
    DATABASE_URL=
    AUTH_SECRET=

    AUTH_GITHUB_ID=
    AUTH_GITHUB_SECRET=
    AUTH_GOOGLE_ID=
    AUTH_GOOGLE_SECRET=

    STRIPE_SECRET_KEY=
    STRIPE_WEBHOOK_SECRET=
    STRIPE_PRICE_STARTER_PRO_ONE_TIME=

    RESEND_API_KEY=
    AUTH_EMAIL_FROM=
    ```

    Production secrets should not reuse local test values unless the system is intentionally still in test mode.
  </Step>

  <Step>
    ### Validate authentication

    Test the full auth lifecycle:

    * credentials sign in
    * OAuth sign in
    * registration
    * email verification
    * forgot password
    * reset password
    * password change
    * protected route redirects
    * session-aware navigation
    * connected account behavior
  </Step>

  <Step>
    ### Validate billing

    Test the full Stripe lifecycle:

    * checkout session creation
    * successful payment
    * canceled payment
    * billing portal session
    * webhook signature verification
    * subscription created event
    * subscription updated event
    * subscription canceled event
    * invoice payment succeeded event
    * invoice payment failed event
  </Step>

  <Step>
    ### Validate backend and access

    Confirm that product data is not only displayed, but protected correctly:

    * migrations run
    * database client is generated
    * seed data works only where expected
    * ownership checks work
    * protected data requires a session
    * paid features require valid billing state
    * server-side rules match UI state
  </Step>

  <Step>
    ### Validate secure delivery

    If your product includes paid downloads or fulfillment, test:

    * payment confirmation
    * purchase-to-access mapping
    * private asset storage
    * download token creation
    * token expiration
    * unauthorized access behavior
    * interrupted session recovery
  </Step>

  <Step>
    ### Validate production deployment

    Build and deploy intentionally.

    ```bash title="terminal"
    pnpm build
    pnpm start
    ```

    Then validate the production URL:

    * `/login`
    * `/register`
    * `/dashboard`
    * `/billing`
    * `/settings`
    * paid access flows
    * webhook endpoint
  </Step>
</Steps>

### Auth checklist

<DocsDecisionGrid
  columns={3}
  items={[
  {
    eyebrow: "Required",
    title: "Required auth behavior",
    icon: LockKeyhole,
    description:
      "Confirm that authentication works end-to-end for real users before launch.",
    items: [
      "users can register",
      "users can sign in",
      "users can sign out",
      "sessions persist correctly",
      "protected routes redirect anonymous users",
      "authenticated users do not need unnecessary auth pages",
    ],
  },
  {
    eyebrow: "Security",
    title: "Auth security checks",
    icon: ShieldCheck,
    description:
      "Validate recovery, provider, and error behavior before the product reaches real users.",
    items: [
      "forgot password does not reveal whether an email exists",
      "reset tokens expire",
      "provider disconnect cannot lock users out",
      "server-side validation exists for auth actions",
      "error messages are useful but not overly specific",
    ],
  },
  {
    eyebrow: "UX",
    title: "Auth UX checks",
    icon: KeyRound,
    description:
      "Auth should feel calm, predictable, and clear across loading, error, and success states.",
    items: [
      "loading states are visible",
      "forms disable submit while processing",
      "errors are field-level when possible",
      "global auth errors are clear and calm",
      "success states explain the next step",
    ],
  },
]}
/>

### Billing checklist

<DocsDecisionGrid
  columns={3}
  items={[
  {
    eyebrow: "Checkout",
    title: "Checkout checks",
    icon: CreditCard,
    description:
      "Validate payment entry points and Stripe session creation before production use.",
    items: [
      "checkout sessions are created on the server",
      "success URL works",
      "cancel URL works",
      "customer mapping is correct",
      "test and production prices are not mixed",
    ],
  },
  {
    eyebrow: "Webhooks",
    title: "Webhook checks",
    icon: ShieldCheck,
    description:
      "Webhook state should be verified, idempotent, and reflected correctly in your app.",
    items: [
      "webhook signatures are verified",
      "events are handled idempotently",
      "subscription create/update/delete events sync correctly",
      "invoice payment events update billing state",
      "failed payments show a clear product state",
    ],
  },
  {
    eyebrow: "Access",
    title: "Billing access checks",
    icon: CheckCircle,
    description:
      "Paid access should depend on synchronized backend billing state, not only client UI.",
    items: [
      "paid features require active access",
      "canceled subscriptions remove access when appropriate",
      "past-due state is handled clearly",
      "billing page reflects synchronized backend state",
      "portal access is only available to the correct customer",
    ],
  },
]}
/>

### Backend checklist

| Check                                  | Why it matters                      |
| -------------------------------------- | ----------------------------------- |
| Migrations run cleanly                 | Prevents broken production deploys  |
| Prisma client is generated             | Ensures typed database access       |
| Auth models are present                | Supports sessions and accounts      |
| Billing models are present             | Supports subscriptions and invoices |
| Ownership checks exist                 | Protects user data                  |
| Plan checks are server-verifiable      | Prevents client-only access control |
| Webhook events are tracked             | Reduces duplicate processing risk   |
| Environment-specific data is separated | Avoids mixing test and production   |

<Callout title="Backend principle">
  If a rule affects money, identity, or private data, it should not live only in
  the frontend.
</Callout>

### Delivery checklist

Use this if Starter Pro delivery or another paid digital product flow is active.

| Check                           | Required behavior                         |
| ------------------------------- | ----------------------------------------- |
| Payment is confirmed by webhook | Access is not granted from redirect alone |
| Download asset is private       | No permanent public file URL              |
| Delivery token exists           | Access can be controlled                  |
| Token expires                   | Shared links have limited value           |
| Unauthorized access is rejected | Non-buyers cannot download                |
| Expired token path is handled   | Buyer has a recovery path                 |
| Confirmation copy is clear      | Buyer knows what happens next             |

## Go / no-go decision

<PreferAvoid
  preferTitle="Ready to launch when"
  avoidTitle="Do not launch if"
  prefer={[
  "authentication flows pass end-to-end",
  "billing webhooks synchronize state correctly",
  "protected routes enforce access properly",
  "database migrations are stable",
  "delivery is secure and tested",
]}
  avoid={[
  "checkout works but webhooks are untested",
  "access is granted from client state only",
  "password reset or verification flows are broken",
  "production secrets are incomplete",
  "paid files are publicly exposed",
]}
/>

## Common mistakes

<Accordions type="single">
  <Accordion title="Launching after checkout works, but before webhooks are validated">
    Checkout is not enough. Webhooks synchronize the billing state that your app should trust for subscription and access decisions.
  </Accordion>

  <Accordion title="Using client-side state for sensitive access checks">
    Client-side state can guide UI, but sensitive access checks should be
    server-verifiable.
  </Accordion>

  <Accordion title="Mixing Stripe test and live configuration">
    Test and live keys, products, prices, and webhook secrets are separate.
    Validate the correct environment before going live.
  </Accordion>

  <Accordion title="Treating delivery as an afterthought">
    If users buy a digital product, fulfillment is part of the product experience. Checkout is only half of the journey.
  </Accordion>
</Accordions>

### Final pre-launch sequence

Before launching, run through this final sequence:

1. deploy to preview
2. run auth flows
3. run Stripe test checkout
4. verify webhook events
5. confirm database updates
6. confirm paid access state
7. test protected routes
8. test delivery access
9. review production environment variables
10. deploy production
11. run one final smoke test

<Callout title="Launch with confidence">
  A strong launch is not just a clean UI. It is a product where identity,
  revenue, data, and access behave correctly together.
</Callout>

<DocsUpgradeCTA title="Launch when the critical systems agree." description="Starter Pro gives you the foundation, but production readiness comes from validating auth, billing, backend, delivery, and deployment together." productSlug="starter-pro" buyLabel="Get Starter Pro" secondaryHref="/pricing" secondaryLabel="View pricing" />

## Next steps

<DocsLinks
  variant="grid"
  items={[
  {
    title: "Authentication system",
    href: "/docs/starter-pro/auth",
    description:
      "Review authentication, sessions, providers, and account lifecycle.",
    icon: LockKeyhole,
  },
  {
    title: "Billing system",
    href: "/docs/starter-pro/billing",
    description:
      "Validate Checkout, portal, webhooks, invoices, and subscription state.",
    icon: CreditCard,
  },
  {
    title: "Backend foundations",
    href: "/docs/starter-pro/backend",
    description:
      "Validate database, ownership, access rules, and server-side boundaries.",
    icon: Database,
  },
  {
    title: "Secure delivery",
    href: "/docs/starter-pro/delivery",
    description:
      "Validate post-purchase access, tokens, private storage, and fulfillment.",
    icon: Download,
  },
]}
/>