NestJS
Build a real backend for NestJS in your browser: modules, controllers, providers, dependency injection, pipes, guards and interceptors, graded by calling your endpoints.
- courses
- 10
- lessons
- 92
- follows
- the official docs
Courses
The mental model of every Nest application: modules, controllers, providers and dependency injection, then each stage of the pipeline Nest runs around a request handler. One lesson per page of the official docs' Overview chapter, on one growing cats API.
Building blocks
The request pipeline
The dependency injection container underneath every Nest application: what a provider token really is, factories, async and dynamic modules, scopes, cycles, the module reference, lazy loading, lifecycle hooks and metadata. One lesson per page of the official docs' Fundamentals chapter, on the same cats API.
Providers in depth
The container at runtime
Tests that run in your browser against real Nest classes: unit tests with the testing module, mocks and spies, controllers and guards in isolation, end-to-end tests over HTTP, and writing the code to make a given test pass. Every test you write is checked by bugs it has to catch.
The whole application
The docs' Techniques chapter on the same cats API: configuration from .env, validation and serialization, a real database with TypeORM, then the HTTP toolbox (versioning, cookies, sessions, uploads, streamed files, server-sent events, calling other services) and what runs behind a request (caching, logging, events, scheduled tasks).
Data
Behind the request
The docs' Security chapter on the same cats API: sign visitors in with JWTs and hash their passwords, decide what each of them may do with roles and policies, do the same the Passport way, then harden the service with helmet, CORS, CSRF protection and rate limiting, and finish with the whole API locked down.
Hardening
The whole API
Describe the cats API so that people and tools can read it: generate an OpenAPI document from the code you already have, shape every schema, parameter and response with the @nestjs/swagger decorators, declare how callers authenticate, reuse DTOs through mapped types, and serve more than one specification from the same app.
Describing the API
Shaping the document
Split the cats API into a service and a gateway that talk over TCP: request-response messages and events, replies that stream or time out, errors that cross the wire, the pipeline on a message, apps that both serve HTTP and listen for messages, a transport of your own, CQRS, and the health checks an orchestrator reads.
Around the handler
Building services
Serve the cats API as a GraphQL schema, code first: object types and resolvers, arguments and field resolvers, mutations with validated inputs, enums, scalars, interfaces and unions, guards on the GraphQL context, field middleware and Apollo plugins, subscriptions, and tests that query the schema.
The schema
Around the resolvers
Beyond queries
Make the cats API live: gateways on socket.io, acknowledgements and events, broadcasts, rooms and namespaces, the request pipeline (filters, pipes, guards and interceptors) around a message instead of a request, connections refused at the handshake, and tests that talk to a gateway like a client.
Gateways
Around the handler
Testing
Build one complete NestJS service from a specification, using everything the other courses taught: configuration and validation, a database with transactions, accounts and roles, the hardening a public API needs, an OpenAPI document and live updates over WebSockets, and finally the end-to-end tests that prove it all.