docs / deployment
Deployment
Vercel and Docker guides with env checklists
Before you deploy
- Run the full gate locally:
pnpm verifypluspnpm e2e. - Confirm the env matrix for your target mode — key names per mode live in the env matrix module; values come from your secret manager, never from the repo.
- Decide the mode:
demofor a public sample,production-kitfor your own product.
Vercel checklist
- Import the repository into Vercel and select the Next.js app.
- Set the environment variables for your mode (see the env matrix; demo requires the Supabase keys, Google OAuth client, and admin allowlist).
- Point
DATABASE_URLat your Supabase Postgres and run migrations:pnpm db:setup. - Seed demo data when deploying the public sample:
pnpm db:seed. - Update the Google OAuth client and Supabase redirect list with the deployed callback, e.g.
https://demo.buildgrain.com/auth/callback. - Schedule the nightly reset job (cron): restore protected seed accounts and remove visitor workspaces inactive for 24 hours.
- Smoke-check after deploy: sign in with Google, create a project, open the admin console, and confirm the boundary chips render on the public entry.
Docker checklist
- Build the app image with the provided Dockerfile and run it next to Postgres via docker compose.
- Supply env vars through an env file or your orchestrator's secret store — the compose file references key names only.
- Run migrations on boot (
pnpm db:setup) before the app container reports healthy. - Expose port 3000 and set the app callback URL to your host, e.g.
http://localhost:3000/auth/callbackfor local Docker. - For offline development, run Postgres locally and leave the OAuth keys unset — the login screen shows the setup blocker instead of failing silently.
Demo mode boundary
The public sample must keep its no-charge boundary: entitlement state is simulated, the billing provider slot stays disabled, and mail delivers to the local preview queue only. Never expose a test auth bypass or fake Google login on a public deployment.
Billing provider (buyers)
The kit ships a Stripe-ready billing module behind the STRIPE_SECRET_KEY env flag. It stays off in demo mode. In production-kit mode, configure your own Stripe keys and enable the module after reviewing the provider documentation — enabling live mode is your decision and responsibility as the buyer.
Post-deploy verification
/app/*and/admin/*guards respond correctly for signed-out users.- Tenant isolation: a second Google account cannot see the first account's workspace.
- The nightly reset job ran within the last 24 hours (check the admin Events surface).
pnpm check:ui-copypasses against the deployed branch — no forbidden public copy.