Skip to content

piarconcept/piar-turbo-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PIAR Monorepo Template

Production-ready monorepo template for building modern web applications with Next.js, NestJS, and shared TypeScript packages.

Used in Production

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.

Quick Start

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 verify

Run 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 dev

Repository Structure

piar-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

Applications

  • @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)

Current Template Baseline

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

Shared Packages (highlights)

  • @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

Common Commands

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

Ports (defaults)

  • Web: Next.js default 3000
  • Backoffice: Next.js default 3000 (set PORT=3001 if running both)
  • Web BFF: 5010
  • Backoffice BFF: 5050

Documentation

Start here: docs/AI-context.md

Key docs:

  • docs/features/repository-configuration.md
  • docs/features/creating-packages.md
  • docs/features/creating-features-guide.md
  • docs/features/testing-guide.md
  • docs/features/tailwind-v4-implementation.md

Contributing

See CONTRIBUTING.md for workflow and commit rules.

Security

See SECURITY.md for reporting vulnerabilities.

Code of Conduct

See CODE_OF_CONDUCT.md for community guidelines.

Commit Convention

This repo uses Conventional Commits enforced by commitlint.

Format:

type(scope): short description

Common types:

  • feat: new feature
  • fix: bug fix
  • chore: tooling or maintenance
  • docs: documentation only
  • refactor: code change without behavior change
  • test: add or update tests

Examples:

feat(ui): add button variants
fix(api): handle missing auth token
docs(readme): document commit convention

License

MIT License. See LICENSE.

About Piar Concept

This template is created and maintained by Piar Concept.

If you want to help us keep building and sharing ambitious open-source tooling:

About

Production-ready monorepo template for building modern web applications with Next.js, NestJS, and shared TypeScript packages.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors