Skip to main content

Bootstrap sequence

The application starts in main.ts:

Global middleware stack

Applied in order in main.ts:

Global exception filters

Two filters are registered globally in main.ts.

PrismaExceptionFilter

Catches Prisma.PrismaClientKnownRequestError and maps Prisma error codes to semantic HTTP responses: The filter humanizes constraint names (for example Order_submittedById_fkey becomes “order”) for user-facing messages.

HttpExceptionFilter

Catch-all filter. Passes NestJS HttpException subclasses through with their original status codes. Any unknown error is logged and returned as a sanitized 500:
No stack traces or internal details reach the client.

Authorization stack

Every request passes through three guards registered by the global AuthModule: The guards’ configuration and internals are documented in Authorization.

Rate limiting

Configured via @nestjs/throttler:
Applied globally with no per-route overrides. Bulk operations use single batched requests instead of N individual calls precisely so large selections stay under this limit.

Request timeout

Set to 15 minutes in main.ts:
This accommodates large report generation and CSV imports.