| name | nean-stack |
| description | Stack decisions for NEAN apps (NestJS, Angular, Nx monorepo). Reference before scaffolding or architecture work. |
Locked decisions
| Layer | Decision |
|---|
| Monorepo | Nx with integrated monorepo |
| Frontend | Angular 21+ (standalone, zoneless), TypeScript required |
| UI Components | PrimeNG 21+ + Tailwind CSS v4 |
| State | NgRx (signals-based where appropriate) |
| Backend | NestJS 11+ with TypeScript |
| ORM | TypeORM with PostgreSQL |
| Validation | class-validator + class-transformer |
| Shared Types | libs/shared/types (DTOs, interfaces, enums) |
| Auth | Passport.js (JWT + Refresh tokens) |
| Authorization | CASL (attribute-based access control) |
| API Docs | Swagger/OpenAPI via @nestjs/swagger |
| Environments | local โ staging โ production |
| Secrets | .env files for dev; cloud provider secrets for prod |
| Containers | Docker for production; optional for development |
Project layout
<app-name>/
โโโ apps/
โ โโโ api/ # NestJS backend
โ โ โโโ src/
โ โ โโโ app/ # Root module
โ โ โโโ modules/ # Feature modules
โ โ โโโ main.ts # Entry point
โ โโโ web/ # Angular frontend
โ โโโ src/
โ โโโ app/ # Root component + routing
โ โโโ main.ts # Bootstrap
โโโ libs/
โ โโโ shared/
โ โ โโโ types/ # DTOs, interfaces, enums (used by both)
โ โโโ api/
โ โ โโโ database/ # TypeORM config, entities
โ โ โโโ common/ # Interceptors, filters, pipes
โ โโโ web/ # (added as needed for feature libs)
โโโ docker/
โ โโโ Dockerfile.api
โ โโโ Dockerfile.web
โ โโโ docker-compose.yml
โ โโโ nginx.conf
โโโ nx.json
โโโ package.json
โโโ tsconfig.base.json
When to add additional services
Only justified if:
- Long-running jobs exceed typical request timeouts
- WebSocket/persistent connections required at scale
- Separate scaling requirements for specific workloads
- Compliance requires service isolation
- Background job processing (consider Bull/BullMQ first)
Default: keep API in single NestJS application with modules.
Reference
For versions, env setup, and deployment patterns, see reference/nean-stack-reference.md