Starter Docs

Deploy

Host web and docs on Vercel, Nest API on Render with Neon Postgres.

Ship the Starter stack without Docker on the public internet:

AppPlatformNotes
apps/webVercelNext.js, Bun monorepo install
apps/docsVercelSeparate Vercel project
apps/nest-apiRenderDocker Blueprint + Neon DATABASE_URL
DatabaseNeonServerless Postgres (TLS auto-detected)

Repo files: apps/web/vercel.json, apps/docs/vercel.json, root render.yaml.

1) Neon database

  1. Create a project at console.neon.tech.
  2. Copy the pooled connection string (includes sslmode=require).
  3. You will paste it into Render as DATABASE_URL. Nest enables TLS automatically for neon.tech URLs.

2) Nest API on Render

  1. In Render, New → Blueprint and connect this GitHub repo (or create a Web Service with Docker).
  2. Use render.yaml at the repo root (dockerfile apps/nest-api/Dockerfile, context .).
  3. Fill sync: false env vars in the dashboard:
VariableExample
DATABASE_URLNeon pooled URL
RESEND_API_KEYre_... from Resend
AUTH_EMAIL_FROMStarter <noreply@your-domain.com>
WEB_APP_URLhttps://your-web.vercel.app (set after step 3)
CORS_ORIGINsame as WEB_APP_URL (comma-separate preview URLs if needed)
WEBAUTHN_RP_IDyour-web.vercel.app (hostname only)
WEBAUTHN_ORIGINhttps://your-web.vercel.app

Blueprint already sets COOKIE_SAME_SITE=none, TRUST_PROXY=true, and generates JWT_SECRET, AUTH_TOKEN_SECRET, and AI_SERVICE_TOKEN.

  1. Deploy and confirm health:
curl -sS https://<your-service>.onrender.com/api/v1/health

Migrations run on container start when RUN_MIGRATIONS=true (default in the Blueprint).

Note: Free Render services spin down when idle; the first request can take ~30s. AI assist still needs a hosted apps/ai-api (AI_API_URL) later — Nest will boot without it.

3) Web on Vercel

  1. Add New Project → import the same repo.
  2. Root Directory: apps/web.
  3. Enable Bun (Project Settings → General → Package Manager, or rely on vercel.json install).
  4. vercel.json already sets install/build via Turbo (--filter=web).
  5. Environment variables:
VariableValue
NEXT_PUBLIC_NEST_API_URLhttps://<your-service>.onrender.com (no /api path)
NEXT_PUBLIC_GOOGLE_CLIENT_IDoptional; must match Nest GOOGLE_CLIENT_ID
  1. Deploy. Then go back to Render and set WEB_APP_URL / CORS_ORIGIN / WebAuthn to this Vercel URL, and redeploy Nest if needed.

NEXT_PUBLIC_* is baked at build time — change the API URL → redeploy web.

4) Docs on Vercel

  1. Add another project from the same repo.
  2. Root Directory: apps/docs.
  3. Env (optional, for docs AI chat):
VariableValue
OPENROUTER_API_KEYfrom OpenRouter
OPENROUTER_MODELe.g. anthropic/claude-3.5-sonnet
  1. Deploy. Docs do not call Nest.

Cross-origin auth (important)

Web (*.vercel.app) and API (*.onrender.com) are different sites. Refresh cookies use:

  • COOKIE_SAME_SITE=none
  • Secure (HTTPS)

Local Docker stays on COOKIE_SAME_SITE=lax (default). Do not set COOKIE_DOMAIN across Vercel and Render hostnames — it cannot glue them.

Long-term option: put both under one parent domain (e.g. app.example.com + api.example.com) and tighten cookie settings.

Checklist

  • Neon DATABASE_URL on Render
  • Resend key + verified from-address
  • Nest health returns OK
  • Web NEXT_PUBLIC_NEST_API_URL → Render origin
  • Nest CORS_ORIGIN / WEB_APP_URL → Vercel web URL
  • Login works (cookie + credentials)
  • Docs project live (optional OpenRouter)
  • Docker — local Compose stack
  • Production roadmap — product phases
  • Nest API README production notes under apps/nest-api/

On this page