A modern, production-ready monorepo template to kickstart your Full-stack development with Next.js, NestJS, and shared configuration packages.
This is a comprehensive monorepo template built with pnpm workspaces and Turbo for efficient builds and task orchestration. It provides a solid foundation for building scalable Full-stack applications with shared configuration, design systems, and utilities.
web: Next.js 16 + React 19 app with TypeScript, Tailwind CSS v4, Jest, and Playwrightapi: NestJS 11 API with TypeScript, TypeORM, Helmet, Compression, Jest, and Supertest
@repo/design-system: Shared UI components and utilities (Tailwind CSS + shadcn/ui)@repo/env: Centralized environment variable validation with Zod@repo/database-typeorm: TypeORM DataSource configuration and migrations@repo/jest: Shared Jest configurations for testing@repo/playwright: Shared Playwright configuration for E2E tests@repo/typescript: Shared TypeScript configurations@repo/tsup: Shared tsup configuration for bundling packages
- Monorepo: pnpm workspaces + Turbo
- Frontend: Next.js 16, React 19, TypeScript
- Backend: NestJS, TypeScript
- Styling: Tailwind CSS v4
- Database: TypeORM + PostgreSQL
- Testing: Jest, Playwright, Supertest
- Linting/Formatting: Biome
- Git hooks: Husky + Commitlint
- Containerization: Docker + Docker Compose
- Node.js >= 22
- pnpm >= 10.26.2
- Docker (optional, for containerized development)
Install dependencies:
pnpm installBuild all apps and packages:
pnpm buildRun all apps in development mode:
pnpm devOr run individual apps:
# Web app (Next.js)
pnpm --filter web dev
# API (NestJS)
pnpm --filter api devOpen http://localhost:3000 for the web app and http://localhost:3001 for the API.
fullstack-monorepo-template/
├─ apps/
│ ├─ web/ # Next.js 16 + React 19 app
│ └─ api/ # NestJS 11 API
├─ packages/
│ ├─ design-system/ # UI components and utilities
│ ├─ env/ # Environment validation
│ ├─ database-typeorm/ # TypeORM configuration
│ └─ config/ # Shared configurations
│ ├─ jest/
│ ├─ playwright/
│ ├─ typescript/
│ └─ tsup/
├─ docker-compose.*.yaml
├─ package.json
├─ pnpm-workspace.yaml
└─ turbo.json
pnpm dev # Run all apps in dev mode
pnpm build # Build all apps and packages
pnpm lint # Check lint and formatting across all apps and packages
pnpm lint:fix # Fix lint and formatting across all apps and packages
pnpm lint:fix:unsafe # Fix lint and formatting (including unsafe fixes)
pnpm typecheck # Type-check all TypeScript filespnpm start:dev # Start all built apps (development env)
pnpm start:staging # Start all built apps (staging env)
pnpm start:production # Start all built apps (production env)pnpm test:unit # Run unit tests across all apps
pnpm test:e2e # Run end-to-end tests across all apps
pnpm test:all # Run all tests across all appspnpm docker:dev # Start development environment
pnpm docker:staging # Start staging environment
pnpm docker:production # Start production environmentpnpm migrate:up:dev # Run migrations (development)
pnpm migrate:down:dev # Revert migrations (development)
pnpm clear:db:dev # Clear database (development)pnpm commit # Interactive commit with CommitizenEnvironment files are managed at the monorepo root and validated via @repo/env:
.env.development- Development environment.env.staging- Staging environment.env.production- Production environment.env.test- Test environment
This monorepo uses pnpm workspaces with the workspace:* protocol for internal dependencies. All shared packages are automatically linked and hot-reloaded during development.
- Create a new branch from
main - Make your changes
- Run
pnpm lint:fixandpnpm typecheck - Run
pnpm test:allto verify nothing is broken - Commit using
pnpm commit(follows Conventional Commits) - Create a Pull Request