NestJS patterns -- modules, DI, exception filters, validation pipes, guards, interceptors, testing, config
98
89%
Does it follow best practices?
Impact
100%
1.36xAverage score across 12 eval scenarios
Passed
No known issues
A restaurant chain is building a new online ordering backend. The ops team has a working menu service but needs a new orders endpoint that accepts customer orders containing multiple items. Each item has a menu item ID, a size (e.g. "small", "large"), and a quantity. The marketing team has strict requirements that the API must reject incomplete or malformed requests before they reach any business logic, and the mobile apps expect a consistent JSON shape for all successful responses.
You have been asked to implement the orders feature module for this NestJS application. The module should expose:
/orders endpoint that accepts a customer name and a list of order items, validates the entire payload including the nested items array, and returns the created order./orders endpoint that returns all orders./orders/:id endpoint that returns a single order by ID.A stub OrdersService with create(), findAll(), and findOne() methods can stand in for real persistence (e.g., store orders in an in-memory array).
Produce a working NestJS TypeScript project rooted at orders-api/. The project should include:
src/main.ts — application bootstrapsrc/app.module.ts — root modulesrc/orders/ — the orders feature module (module, controller, service, DTOs)package.json with the required dependencies listed (installation is not required)Do not run npm install or start the server. Just produce the source files.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
nestjs-best-practices
verifiers