| 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