This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed.
Use Node.js 26.12.0 or newer and pnpm 12.14.0 (the version pinned in packageManager). Create the example, then install dependencies and start development from its root:
npx create-turbo@latest -e with-nestjs
cd with-nestjs
pnpm install
pnpm devIf you choose a different directory name when prompted, use that directory instead. The NestJS API runs at localhost:3000, and the Next.js frontend runs at localhost:3001. Turborepo builds shared packages before starting development tasks.
This Turborepo includes the following packages and apps:
.
├── apps
│ ├── auth # NestJS app (https://nestjs.com).
└── packages
└── config # ESLint configurations (includes Prettier)
├── @repo/eslint # ESLint configurations (includes Prettier)
├── @repo/vitest # Vitest configurations
└── @repo/typescript # tsconfig.json files used throughout the monorepoEach package and application is mostly written in TypeScript.
This Turborepo has some additional tools already set up for you:
- TypeScript for static type safety
- ESLint for code linting
- Prettier for code formattingWW
Run these commands from the monorepo root.
# Build all apps and packages that have a `build` script.
pnpm build# Run development servers for all apps and packages that have a `dev` script.
pnpm dev# Run unit tests for all apps and packages that have a `test` script.
pnpm test
# Run end-to-end tests for all apps and packages that have a `test:e2e` script.
pnpm test:e2eSee @repo/vitest-config to customize test behavior.
# Lint all apps and packages that have a `lint` script.
pnpm lintSee @repo/eslint-config to customize lint behavior.
# Type-check all apps and packages that have a `check-types` script.
pnpm check-types# Format supported TypeScript, TSX, and Markdown files.
pnpm formatSee @repo/eslint-config/prettier-base to customize formatting.
Tip
Vercel Remote Cache is free for all plans. Get started today at vercel.com.
Turborepo can use Remote Caching to share cache artifacts across machines and CI.
By default, Turborepo caches locally. To enable Remote Caching, create a Vercel account, then authenticate:
pnpm turbo loginNext, link the repository to Remote Cache from the repository root:
pnpm turbo linkThis example takes inspiration from the with-nextjs Turborepo example and the 01-cats-app NestJS sample.
Learn more about Turborepo: