# `nestjs-enterprise` preset

> Secondary backend. Use as a queue worker host, websocket gateway, or BFF in front of the .NET API.

## What you get

- **`apps/api-nest/`** — NestJS 11 application with:
  - Modules: `Auth`, `User`, `Role`, `Permission`, `Prisma`, `Redis`, `Cache`, `Config`, `Health`, `Metrics`, `Audit`, `Queue` (BullMQ), `Websocket`, `Notification`
  - Cross-cutting: `AllExceptionsFilter`, `ValidationFilter`, `LoggingInterceptor`, `TransformInterceptor`, `TimeoutInterceptor`, `JwtAuthGuard`, `PermissionGuard`, `ThrottlerGuard`, `ValidationPipe`
  - Base classes: `ApiResponse<T>`, `PagedResponse<T>`, `BaseEntity`, `AuditableEntity`, `BaseRepository<T>`, `BaseService<T>`, `BaseController<T>`
  - Logger: pino, JSON-structured, correlation-id propagation
- **`apps/worker-nest/`** — separate process consuming BullMQ queues for audit shipping, email/SMS/push delivery, scheduled jobs

## When it applies

Materialized whenever `extends` contains `nestjs-enterprise`. Works alongside `dotnet-enterprise` as a secondary host.

## Composes with

| Preset                                     | Notes                                                          |
| ------------------------------------------ | -------------------------------------------------------------- |
| `dotnet-enterprise`                        | Shares the same Postgres + Redis; coordinate domain boundaries |
| `angular-enterprise` / `nextjs-enterprise` | Frontends consume via shared `packages/api-contracts/`         |

## Phase mapping

- Phase 2 (this phase): preset manifest + README
- Phase 4: full source materialization (`apps/api-nest/`)
- Phase 6: `apps/worker-nest/` materialization
