A Nest.js application is built from modules, controllers and providers. A module is a class decorated with @Module() that groups related controllers and providers and encapsulates them. A controller handles incoming requests and returns responses. A provider is a class Nest can inject, such as a service, a repository or a factory. Services hold the business logic and are the most common providers.
Smaller pieces bound to a route run around its handler:
Middleware runs before the route handler.
Guards decide whether a request should be handled.
Interceptors add logic around the handler and can transform its result.
Pipes transform and validate input data.
Exception filters handle errors and turn them into responses.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.