Deployment
Production URL planning, env matrix, and when to adopt subdomain deployment.
This kit runs as two Next.js surfaces:
apps/marketingapps/docs
Locally, they use different ports. In production, keep their public URLs explicit through env vars.
Production URL matrix
| Surface | Env var | Example |
|---|---|---|
| Marketing (landing, API, checkout) | NEXT_PUBLIC_MARKETING_URL | https://www.example.com |
| Leftover package CORS / auth origins | NEXT_PUBLIC_APP_URL / NEXT_PUBLIC_SAAS_URL | Same as marketing |
| Docs site | NEXT_PUBLIC_DOCS_URL | https://docs.example.com |
Better Auth reminders
Auth lives in @repo/auth. This repo does not host dashboard auth routes. If you reuse the package, set BETTER_AUTH_URL to the origin that mounts /api/auth. Do not add the docs origin as a trusted origin unless you intentionally need auth flows there.
Subdomain deploy gate
Only add subdomain rewrites or a two-project Vercel setup when you are ready to operate www. and docs. separately.
Payments and webhooks
Storefront Mayar webhooks should point to the marketing origin:
{MARKETING_URL}/api/webhooks/mayar
Leftover kit adapters still document Polar / Midtrans / DOKU webhook paths; those are not hosted here unless you remount them. Full guide: Payments and Storefront checkout.