Bootstrap sequence
The application starts inmain.ts:
Global middleware stack
Applied in order inmain.ts:
Global exception filters
Two filters are registered globally inmain.ts.
PrismaExceptionFilter
CatchesPrisma.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 NestJSHttpException subclasses through with their original status codes. Any unknown error is logged and returned as a sanitized 500:
Authorization stack
Every request passes through three guards registered by the globalAuthModule:
The guards’ configuration and internals are documented in Authorization.
Rate limiting
Configured via@nestjs/throttler:
Request timeout
Set to 15 minutes inmain.ts: