This configuration combines Next.js API routes with Bun’s fast runtime. It provides the best of both worlds: Next.js’s familiar API structure with Bun’s performance benefits.
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 |
---|---|
bun dev | Start all services |
bun build | Build for production |
bun dev:web | Frontend + API only |
bun check-types | TypeScript validation |
bun db:push | Update database schema |
bun db:studio | Database management UI |
apps/web/.env
NEXT_PUBLIC_
prefix for client-side variablesAspect | Bun | Node.js |
---|---|---|
Startup Time | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
Memory Usage | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
Package Installation | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
Hot Reload | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
Build Speed | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
apps/web/.env
apps/web/.env
NEXT_PUBLIC_
prefix for client variablesapps/web/src/components
apps/web/src/app/api
apps/cms/src/collections