This configuration uses Next.js API routes as the backend with Node.js runtime. The key difference is that all server environment variables need to be copied to the web application.
server/.env
to web/.env
because the API routes run within the Next.js
application.apps/web/.env
with ALL environment variables:
apps/web/.env
because the API routes run within the Next.js application.apps/cms/.env
:
Command | Description |
---|---|
pnpm run dev | Start all services |
pnpm run build | Build for production |
pnpm run dev:web | Frontend + API only |
pnpm run check-types | TypeScript validation |
pnpm run db:push | Update database schema |
pnpm run db:studio | Database management UI |
apps/web/.env
NEXT_PUBLIC_
prefix for client-side variablesapps/web/.env
apps/web/.env
apps/web/src/components
apps/web/src/app/api
apps/cms/src/collections