Skip to main content
Operations

Deployment

Build, configure and verify the TanStack Start Prisma edition.

Open MarkdownFull AI corpusFeedback

Runtime and build

The application builds with Vite and runs through Nitro. Use the patched Node.js 22 version pinned in the repository and configure environment variables before building.

At minimum, set DATABASE_URL, a fresh BETTER_AUTH_SECRET and NEXT_PUBLIC_SITE_URL with your public HTTPS origin. Add email, Google, Stripe, S3 and AI credentials only for the providers you intend to use.

npm ci
npm run build
npm run db:migrate
npm run start

The standalone server entry point is .output/server/index.mjs. npm run start launches it with the production environment. Apply committed database migrations as a controlled deployment step; do not use db:push against a production database.

Vercel

The repository's vercel.json selects the TanStack Start framework. Link the intended project and team, configure its production environment, build, and test the deployment before assigning your public domain.

The standard Vercel build does not replace a database-migration step. Apply migrations against the intended database using your deployment process. Keep database and server regions close to each other.

If you clone a demo configuration, replace its database URL, auth secret, provider credentials and price IDs. Do not reuse a demo's production secrets.

Public and private environment values

Vite embeds public environment values at build time. Changing NEXT_PUBLIC_SITE_URL, a public Stripe key or a public price ID requires a new build. Never prefix secrets with NEXT_PUBLIC_ or VITE_.

The kit normalizes the public deployment metadata needed for trusted origins across Vercel's build and runtime environments. This does not expose server secrets or remove the need to set the correct site URL.

Provider checklist

  • Email: verify the sending domain and test verification, password reset and invitation delivery.
  • Google: register the exact /api/auth/callback/google URL for the public application origin.
  • Stripe: use an endpoint-specific signing secret at /api/webhooks/stripe and confirm a test event is delivered. Hosted Checkout is the default.
  • Storage: configure the existing S3-compatible bucket and test avatar and organization-logo uploads. The included server upload route does not require browser-upload CORS.
  • Observability: configure Sentry as described in README_OBSERVABILITY.md and inspect runtime errors without logging credentials.

Before going live

Run type checks, lint, unit tests and a production build. In the deployed application, test sign-up and verification, sign-in and logout, two-factor recovery, organization membership, owner/admin/member permissions, uploads, checkout and webhook delivery.

See TanStack's hosting guide, its environment-variable guide and Vercel's TanStack Start guide.