Switch to Separate
Move a fullstack project to a standalone backend in place - no CLI re-run, no clobbered config.
Fullstack ships apps/backend dormant. Activating it is an in-place rewiring - do it by hand. Re-running the CLI regenerates packages/config/src/index.ts and .env wholesale and overwrites your edits.
The backend needs a long-running host (Docker on Render, Fly.io, Railway, Coolify, Dokploy, or a VPS). separate + vercel is blocked. The frontend can stay on Vercel.
Unmount the API - delete
apps/web-nuxt/server/api/[...paths].ts. The frontend stops serving @repo/api; apps/backend/src/index.ts (already present) now owns it.@repo/api is unchanged - it already lives in apps/web-nuxt devDependencies and stays there; only the AppType type is needed now. Deleting the catch-all route drops the Hono runtime from the frontend build, so no dependency move is required.Repoint the client - set
NUXT_PUBLIC_API_URL to the backend origin (http://localhost:3010 dev, https://api.yourdomain.com prod). This one value re-derives apiBasePath, auth baseURL, CORS, and SSR rewrites - no source edits.Set backend env -
API_PORT=3010, TRUSTED_ORIGINS=<every frontend origin>, plus AUTH_COOKIE_DOMAIN for cross-subdomain cookies. See Separate backend.Move DB ownership - move the schema step (
pnpm -F @repo/database migrate) and DATABASE_URL off the frontend's start/buildCommand onto apps/backend, keeping DATABASE_URL out of the frontend host.Deploy & proxy - deploy
apps/backend (its Dockerfile is ready) and front both apps by host/path. See Reverse proxy.| Concern | Fullstack | Separate |
|---|---|---|
| API mount | frontend catch-all route | apps/backend process |
@repo/api | devDependencies (the catch-all import is bundled by Nitro) | devDependencies (types only) |
NUXT_PUBLIC_API_URL | …/api (same origin) | backend origin |
| DB schema step | frontend | backend |
| Cross-origin env | - | TRUSTED_ORIGINS, AUTH_COOKIE_DOMAIN |
Verify: run both apps and confirm an authenticated browser call succeeds cross-origin.