Production-ready monorepo template for building modern web applications with Next.js, NestJS, and shared TypeScript packages.
This fast-start template has already been used to launch production projects:
We still use this template as the base for all our MVPs and for projects that we expect to scale hard. We keep feeding lessons learned from those repos back into this template, and we will keep improving it with what we learn across the rest of our production codebases.
Prerequisites:
- Node.js 20.x (recommended via
nvm— see.nvmrc) - pnpm 10.28.0
Database requirements:
- This template is designed to run with PostgreSQL (
DATABASE_URL). - You can migrate to MongoDB (or another database), but you must adapt the data layer first:
- Replace TypeORM setup and repository implementations.
- Update feature modules, ports/adapters, and queries where needed.
- For a fast, production-ready setup, we recommend Neon as managed PostgreSQL (quick start, serverless, scalable).
# Optional but recommended
nvm use
pnpm install
cp .env.example .env
pnpm verifyRun apps in dev mode:
pnpm --filter @piar/web dev
pnpm --filter @piar/backoffice dev
pnpm --filter @piar/web-bff dev
pnpm --filter @piar/backoffice-bff devpiar-repo/
├── apps/
│ ├── api/ # NestJS BFFs
│ ├── client/ # Next.js apps
│ └── sqs/ # Queue handlers
├── packages/ # Shared packages
├── docs/ # Documentation and architecture
├── scripts/ # Tooling scripts
├── turbo.json # Turbo config
└── tsconfig.base.json # Base TS config
@piar/web- Public website (Next.js)@piar/backoffice- Admin app (Next.js)@piar/web-bff- Web BFF API (NestJS)@piar/backoffice-bff- Backoffice BFF API (NestJS)
Integrated and validated in this template:
- Auth with access + refresh session flow
- Accounts admin module (CRUD + admin safety rules)
- Backoffice search (accounts collection)
- Contact submissions (public web + backoffice admin)
- Dynamic pages (public web + backoffice admin)
- Backoffice profile page with logout
- TypeORM repositories for account/contact-submission/dynamic-page
Implementation and migration guide:
docs/features/template-baseline-and-feature-migration.md
@piar/domain-models- Domain entities@piar/domain-fields- Field configuration system@piar/messages- i18n messages@piar/ui-config- Tailwind CSS v4 shared config and design tokens@piar/ui-components- Shared UI components@piar/layout- Shared layout components@piar/infra-client-seo- SEO infrastructure (sitemap, robots, validators)@piar/infra-backend-security- Shared JWT security
pnpm turbo build # Build all packages/apps
pnpm typecheck # Type check all packages/apps
pnpm lint # Lint all packages/apps
pnpm test # Run all tests without coverage
pnpm test:coverage # Run all tests with coverage
pnpm verify # Non-mutating repo verification in an isolated copy- Web: Next.js default 3000
- Backoffice: Next.js default 3000 (set
PORT=3001if running both) - Web BFF: 5010
- Backoffice BFF: 5050
Start here: docs/AI-context.md
Key docs:
docs/features/repository-configuration.mddocs/features/creating-packages.mddocs/features/creating-features-guide.mddocs/features/testing-guide.mddocs/features/tailwind-v4-implementation.md
See CONTRIBUTING.md for workflow and commit rules.
See SECURITY.md for reporting vulnerabilities.
See CODE_OF_CONDUCT.md for community guidelines.
This repo uses Conventional Commits enforced by commitlint.
Format:
type(scope): short description
Common types:
feat: new featurefix: bug fixchore: tooling or maintenancedocs: documentation onlyrefactor: code change without behavior changetest: add or update tests
Examples:
feat(ui): add button variants
fix(api): handle missing auth token
docs(readme): document commit convention
MIT License. See LICENSE.
This template is created and maintained by Piar Concept.
- Template page: piar-turbo-template
- Website: piarconcept.com
- Support: support@piarconcept.com
If you want to help us keep building and sharing ambitious open-source tooling:
- Contribute here: Donations