
Learn how to get help while learning NestJS: post questions on the Udemy discussion board, connect with TAs, join the Discord server, or direct message the instructor.
Set up a first NestJS project from scratch, wiring five specified NestJS dependencies and a package.json, while reviewing TypeScript and Node.js basics to understand Nest internals.
Explore how Nest.js uses dependencies like nestjs/common and platform-express, configure an express or fastify adapter, and set up a tsconfig.json with experimental decorators and emit decorator metadata.
Learn to create a Nest module and a controller, using decorators and routing to handle requests, validate data, and return responses at the root route.
Create an app module that registers controllers, bootstraps a Nest application with NestFactory, and serves a simple 'Hi there' route on port 3000.
Learn to refactor a NestJS app by extracting the app controller and app module into their own files, using a class-per-file pattern with names like app.controller.ts and app.module.ts.
Configure routing with the controller and jit decorators, define get routes such as /app/asdf and /app/by, and test how changes affect 404 responses and route handling.
Generate a Nest project with the Nest CLI, then build a messages app stored in a Json file via a controller, service, repository, a validation pipe, and a module.
Use the Nest CLI to generate the messages module, wire it into main.ts, and run npm run start:dev to start a live development server, while optionally disabling eslint.
Generate a messages controller inside the messages module using the nest generate command with the flat option. See how the NestJS CLI wires files, updates the module, and enables routes.
Define routing in NestJS by creating a messages controller with get and post route handlers, using a controller decorator and route decorators to map slash messages and slash messages/:id.
Learn how to test NestJS route handlers using Postman or the VS Code rest client extension, including get requests to /messages and posting JSON bodies to simulate create operations.
Install the VSCode rest client extension, create a request.http file to describe api calls, and use built-in buttons to send get and post requests to localhost:3000/messages with json content.
Learn how NestJS decorators extract data from incoming requests, using body for post payloads and param for URL wildcards, with query and headers options.
Wire up NestJS's built-in validation pipe globally to ensure every incoming request body has a content string, by importing ValidationPipe and using app.useGlobalPipes in main.ts, demonstrating its opt-in nature.
Enable automatic request validation in NestJS by creating a CreateMessageDTO with class-validator, wiring the validation pipe, and applying the DTO to the create message route to enforce a string content.
Explain how NestJS preserves type information from TypeScript to JavaScript using emit decorator metadata. Show how the validation pipe uses metadata to validate request body against the create message DTO.
Explore how Nest services and repositories work together to store and retrieve messages, with services acting as a front for repositories and guiding when to use each.
Implement a messages repository and service from scratch in a NestJS project, adding find one, find all, and create methods that read and write a messages.json file using fs/promises.
Learn to read and write a messages.json file in NestJS, parsing contents, returning the messages object, and adding new messages with a random id.
Create a messages service that wraps a messages repository, providing find one, find all, and create methods, while using dependency injection to connect with the controller and avoid self-created dependencies.
Inject the messages service into the controller and implement list, create, and get routes that return data. Use a create dto with content and test with a client like postman.
Throw a not found exception when a requested message does not exist to return a 404 with a clear message. Nest converts such errors into standard http responses.
Demonstrate why inversion of control and dependency injection matter in NestJS, showing how interfaces enable swapping repositories for production and fast in memory tests. Swap implementations with interfaces.
Learn how dependency injection, via a container, streamlines inversion of control by auto-wiring controllers, services, and repositories, registering classes at startup in a Nest application and reusing created instances.
Build a small computer model to demonstrate modules and dependency injection in NestJS, creating power, CPU, and disk services, and a computer module that ties them together.
Set up a NestJS project by cleaning the src folder, generate computer, cpu, disk, and power modules with services and a controller, and wire the computer module as app entry.
Explore dependency injection across NestJS modules by wiring a power service into CPU and disk services, exporting providers, importing modules, and sharing code between modules.
Connect CPU and disk modules by exporting their services, importing them into the computer module, and wiring a controller to run compute and get data.
Explore how modules interact inside a single dependency injection container, wiring the power and cpu modules with providers and exports, and using imports to share power.
Develop a used car pricing API with NestJS, featuring user sign up and authentication, car value estimates from make, model, year, and mileage, and administrators review reported sales.
Design five routes for signup, sign in, get and post reports, and admin approval, using vehicle make, model, year, mileage, and location to estimate value and update the data set.
Explore module design in NestJS by structuring resources as users and reports with controllers, services, and repositories, and learn how modules organize code and prepare for database integration.
Generate two modules, two controllers, and two services with the nest for a NestJS app; skip repositories and inspect the resulting users and reports modules, controllers, and services.
Explore persistent data in Nest using TypeORM with SQLite for initial setup, with plans to switch to Postgres later. Note Mongoose as a MongoDB option and install nestjs/typeorm, typeorm, sqlite3.
Set up a SQLite database connection in the app module using NestJS TypeORM, shared across modules. Define user and report entities so repositories are created automatically.
Create and wire up user and report entities in a NestJS app, using TypeORM to automatically generate repositories and persist data to SQLite.
Create and connect a report entity with a price field using TypeORM in NestJS, wire it into the reports module and app module, then inspect the SQLite database contents.
Learn how TypeORM decorators define entities, primary generated columns, and columns in a SQLite database, and how synchronization updates the schema in development and why it's avoided in production.
Explore how users and reports repositories, created by TypeORM, enable dependency-injected access to create, save, find, update, remove, and delete data through the user service.
Create extra user routes with controllers and services that use the user repository to find by id or email, update, or delete, illustrating TypeORM and layered architecture.
Add a new post route for auth/signup and implement a Create User DTO to validate email and password, using class-validator, class-transformer, and the global ValidationPipe in main.ts.
Test api routes by crafting post requests to localhost 3000 auth sign up against the users controller, validating emails and passwords, and enforcing a whitelist to strip extraneous properties.
Wire the TypeORM user repository into the service, create and save a user, and test with sqlite before moving to postgres.
Trace the full request flow in NestJS from validating the incoming email and password to creating a user entity and saving it with the repository.
Discover why creating a user entity before saving ensures hooks run in NestJS. Saving a plain object skips hooks, exposing potential bugs; compare save with insert, update, and remove.
Implement find one, find, update, and remove methods in the user service and wire them to the repository, exploring arguments like id and email and clarifying find one versus find.
Learn to implement a flexible update in NestJS by updating a user with an id and a subset of properties, using object.assign and repository save to preserve hooks.
Learn how to remove users in NestJS by using remove on an entity versus delete by id, triggering after remove hooks and handling not-found errors with two database trips.
Build NestJS route handlers in a controller to fetch a user by id and find all users by email, using @Param and @Query decorators and parseInt for id.
Implement a delete route in NestJS to remove a user by id using delete decorator, convert id to a number, and call remove method on the users service.
Explore creating a patch update endpoint in NestJS, with a flexible update user DTO housing optional email and password fields and input validation.
Update the user service to throw NotFound exceptions instead of plain errors, and decide that find one returns null while the controller throws NotFound to yield a 404 across protocols.
Exclude the password from user responses in NestJS by applying class-transformer’s exclude decorator to the user entity and using a class serializer interceptor to shape outgoing json via use interceptors.
Explore the limitations of basic serialization in NestJS and implement per-route data exposure using a custom interceptor and multiple user DTOs to return admin and public views.
Create a custom serialize interceptor in NestJS to intercept incoming requests and outgoing responses, apply it at controller, root handler, or globally, and use rxjs map and plainToClass from class-transformer.
NestJS interceptors convert a user entity to a user dto and expose only id and email for outgoing json, enabling reuse across different data types.
Define a constructor on the interceptor to receive and store the DTO, replacing the hard-coded user DTO and using plainToClass for per-request serialization.
Refactor by creating a simple custom decorator named serialize that wraps the serialize interceptor with a DTO, condensing long code into a compact, reusable call across controllers.
Apply controller-wide serialization to all request handlers, using the serialize user DTO decorator to filter sensitive fields like password from every response; customize per-handler serialization if needed.
Explore the challenges of type safety around decorators in TypeScript and how a class constructor interface enforces that serialized decorator arguments are classes.
Authentication/Authorization? Covered. Automated Testing? Yep, it's here! Production Deployment? Of course!
Congratulations! You've found the complete guide on how to build enterprise-ready apps with NestJS.
NestJS is a backend framework used to create scalable and reliable APIs. It is a "battery-included" framework; it includes tools to handle just about every possible use case, from data persistence, to validation, to config management, to testing, and much, much more. This course will help you master Nest. By the time you complete this course, you will have the confidence to build any app you can imagine.
Throughout this course you will build a series of apps with growing complexity. We use as few libraries and tools as possible. Instead, you will write many custom systems to better understand how every piece of Nest works together. Each application you build includes discussion on data modeling and persistence. We will first save records in a simple file-based data store (built from scratch) and eventually work our way up to saving data in a production-grade Postgres instance.
Testing is a fundamental topic in Nest. A tremendous amount of functionality in Nest is dedicated to making sure your project is easy to test. This course follows Nest's testing recommendations, and you will write both integration and unit tests to ensure your project is working as expected. Although testing can sometimes be confusing and boring, I have put special care into making sure the tests we write are expressive, fast, and effective. You will be able to use this knowledge on your own projects, even those that don't use Nest!
Typescript is used throughout this course to make sure we are writing clean and correct code. Don't know Typescript? Not a problem! A free appendix is included at the end of the course to get you up to speed on Typescript. Once you're familiar with it, Typescript will help you catch errors and bugs in your code before you even run it. If you've never used Typescript before you are in for a treat :)
--------------------------------------
Everything in this course is designed to make your learning process as easy as possible.
At every step, I will teach you what Nest is doing internally, and help you understand how to twist and bend Nest to better suit your application's needs.
Every single video in the course has an attached ZIP file containing up-to-date code, just in case you ever get stuck.
Full-time teaching assistants are standing by to help answer your questions
Access private live chat server is included. Live help whenever you need it!
--------------------------------------
Here's a partial list of the topics included in this course:
Securely deploy your app to production
Write automated integration and unit tests to make sure your code is working
Build an authentication system from scratch to log users in
Allow users to perform certain actions with a permissions system
Store and retrieve data with complex queries using TypeORM
Understand how TypeORM handles data relationships
Write declarative code using property, method, and parameter decorators
Master the concept of dependency injection to write reusable code
Implement automatic validation of incoming requests
Format outgoing response data with a custom DTO system
Handle incoming requests and outgoing responses using Guards and Interceptors
Segment your code into reusable Nest Modules
Add structure to your database using migrations
I had a tough time learning NestJS. There are a tremendous number of outdated tutorials around it, the documentation is sometimes unclear, and Nest itself is just plain hard to understand. I made this course to save you time and money - a course to show you exactly what you need to know about every topic in Nest. You will find learning Nest to be a delightful experience and pick up a tremendous amount of knowledge along the way.
Sign up today and join me in mastering NestJS!