NestJS Zero to Hero - Modern TypeScript Back-end Development
4.7 (3,102 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
59,288 students enrolled

NestJS Zero to Hero - Modern TypeScript Back-end Development

Develop and deploy enterprise back-end applications following best practices using Node.js and TypeScript
Bestseller
4.7 (3,102 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
59,288 students enrolled
Created by Ariel Weinberger
Last updated 5/2020
English
English [Auto], French [Auto], 5 more
  • German [Auto]
  • Indonesian [Auto]
  • Italian [Auto]
  • Portuguese [Auto]
  • Spanish [Auto]
Current price: $20.99 Original price: $29.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 8.5 hours on-demand video
  • 26 articles
  • 4 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Becoming familiar with the NestJS framework and its components
  • Designing and developing REST APIs performing CRUD operations
  • Authentication and Authorization for back-end applications
  • Using TypeORM for database interaction
  • Security best practices, password hashing and storing sensitive information
  • Persisting data using a database
  • Deploying back-end applications at a production-ready state to Amazon Web Services
  • Writing clean, maintainable code in-line with industry standards
  • Utilising the NestJS Command Line Interface (CLI)
  • Using Postman for testing back-end services
  • Using pgAdmin as an interface tool to manage PostgreSQL databases
  • Implement efficient logging in a back-end application
  • Environment-based configuration management and environment variables
  • Implementing data validation and using Pipes
  • Guarding endpoints for authorized users using Guards
  • Modelling entities for the persistence layer
  • TypeScript best practices
  • Handling asynchronous operations using async-await
  • Using Data Transfer Objects (DTO)
  • Hands-on experience with JSON Web Tokens (JWT)
  • Unit testing NestJS applications
  • Using GraphQL with NestJS
  • Database persistence with MongoDB
Course content
Expand all 132 lectures 08:27:32
+ Introduction to NestJS & Pre-requisites
7 lectures 07:09

Welcome to the NestJS Zero to Hero course!

Preview 00:54
Thank you + Future Content
01:33

Introduction to the NestJS Framework.

What is NestJS?
01:59

Node.js and NPM are required to install NestJS and the NestJS CLI.

Installing Node.js and NPM
00:10

I'll guide you on how to install the NestJS CLI globally on your machine.

Preview 02:04
Installing Postman
00:12
(Optional) Installing Visual Studio Code
00:17
+ REST API - Task Management Application (CRUD)
21 lectures 01:25:44

An overview of the project for this course - the Task Management application.

Preview 05:34

Creating the Task Management NestJS project using the NestJS CLI.

Preview 06:22

Introduction to NestJS Modules.

Preview 02:24

Creating a TasksModule that will encapsulate any components and files related to tasks.

Creating a Tasks Module
02:43

Introduction to NestJS Controllers.

Preview 03:29

Creating a TasksController that handles incoming HTTP requests for the tasks resource.

Creating a Tasks Controller
03:08

Introduction to NestJS Providers and Services.

Preview 02:55

Creating the TaskService and injecting it into the controller.

I also explain some design decisions, such as defining the tasks array as private and naming of methods.

Creating a Tasks Service
03:02

Adding the functionality of retrieving all tasks.

Feature: Getting all Tasks
04:37

Defining a model for our Task objects to be based on.

Preview 04:13

The first part is about creating the service method to create a new task.

Preview 05:04

The second part is about handling a POST request in the TasksController, extracting the body parameters and calling the service method to create a new task.

Preview 05:14

Introduction to the concept of Data Transfer Objects, or DTOs.

Preview 06:37

Applying what we learned about Data Transfer Objects and creating a DTO for when creating a new task.

Creating a CreateTaskDto
04:14

Adding support for getting a single task by ID.

Feature: Getting a Task by ID
04:24

In this challenge you'll have to combine all you've learned so far and add the functionality of deleting a task by ID.

Preview 00:44

This is my solution to deleting a task.

Solution: Deleting a Task
05:23

Use the knowledge gained so far to add support for updating a task's status.

Preview 01:14

Here's my solution to the challenge of updating an existing task's status.

Solution: Updating a Task's Status
04:42

Implementing the feature of searching and filtering tasks.

Feature: Searching and Filtering Tasks
09:27
Summary Quiz
6 questions
NEW COURSE + DISCOUNT COUPON
00:14
+ Validation and Error Handling
7 lectures 23:48

Introduction to NestJS Pipes.

Introduction to NestJS Pipes
04:58

Using the NestJS built-in ValidationPipe and the class-validator NPM package, we will validate the "title" and "description" parameters when creating a task.

ValidationPipe: Creating a Task
03:27

Handling a case where a task with a given ID does not exist.

Error Handling: Getting a non-existing Task
03:02

Handling a case where attempting to delete a task that does not exist.

Error Handling: Deleting a non-existing Task
01:43

Creating a custom pipe to validate that the provided status is valid when updating the status.

Custom Pipe: Validating the Task Status
07:05

Using the NestJS built-in ValidationPipe and the class-validator NPM package, we will add validation when applying filters to tasks or searching for tasks by term.

ValidationPipe: Task Filtering and Search
03:25
Summary Quiz
5 questions
Source Code - Validation and Error Handling
00:08
+ Data Persistence - PostgreSQL & TypeORM
16 lectures 56:18
Installing PostgreSQL and pgAdmin
00:14

Using pgAdmin as an interface to create a new database.

Using pgAdmin to create a Database
01:51

Introduction to the TypeORM object-relational-mapping library.

Introduction to Object Relational Mapping and TypeORM
02:48
IMPORTANT: TypeORM Entities Configuration
00:12

Connecting the NestJS application to our database, using TyepOrmModule.

Connecting NestJS to a database using TypeORM
05:22

Creating a TypeORM Entity for tasks.

Creating a Task Entity
01:41

Creating a custom repository for handling task-related database operations.

Creating a Task Repository
03:09

Small changes to our application that will make our persistence refactoring easier.

Preparation for Task Service Refactoring
02:46

Refactoring the "get task by ID" feature, retrieving the tasks from the database.

Persistence: Getting a Task by ID
06:13

Refactoring the "create task by ID" feature, saving the new task in the database.

Persistence: Creating a Task
06:38

Challenge: Refactoring the "delete task by ID" feature, deleting the task from the database table.

Challenge: Delete Task Persistence
01:47

Solution to the challenge fo refactoring the task deletion logic to introduce data persistence.

Solution: Delete Task Persistence
07:13

Persistence support for the operation of updating a task's status.

Persistence: Updating Task Status
03:44
IMPORTANT: Before Persistence of Getting Tasks
02:55

Persistence support for getting tasks (with or without filters).

Persistence: Getting Tasks (with or without filters)
09:37
Summary Quiz
5 questions
Source Code - Data Persistence
00:07
+ (Part 1) Authentication - Setting up JWT/Passport.js
13 lectures 01:08:51
Setting up AuthModule, User Entity and UserRepository
05:30
Feature: Sign Up
08:53
Validation: AuthCredentialsDto, password strength
04:26
Error Handling: Duplicate Usernames
06:04
Security: Hashing Passwords & Using Salts
08:53
Feature: Validating Password - Sign In
08:32

Introduction to JSON Web Tokens (JWT)

Preview 05:01

Setting up NestJS' JwtModule and PassportModule to help us with authentication and authorization.

Setting up the JWT Module and Passport.js
03:39

Signing a JWT token with the relevant payload upon successful authentication.

Signing a JWT Token Upon Authentication
04:43

Setting up the JWT-based strategy to be used by Passport.js for authorizing users.

Setting up the JWT Strategy for Authorization
07:46
IMPORTANT: GetUser Decorator
00:18

Creating a custom @GetUser() decorator to retrieve the user from the request object.

Custom @GetUser() Decorator
02:50

Applying an authorization guard on the Tasks routes.

Guarding the Tasks Routes (TasksController)
02:16
Summary Quiz
6 questions
+ (Part 2) Authorization - Task Ownership
7 lectures 20:12
Tasks and Users - Database Relation
03:45
Authorization: Creating a Task For User
04:15
Authorization: Getting Tasks For User
05:27
Authorization: Getting a User's Task
02:53
Authorization: Updating a User's Task Status
01:29
Authorization: Deleting a User's Task
02:16
Source Code - Authentication & Authorization
00:07
+ (Bonus) Logging
2 lectures 15:15
Introduction to Logging
02:31
Applying logging in our application
12:44
+ (Bonus) Pro-Production: Configuration
5 lectures 16:31
Windows: Environment Variables
00:14
Introduction to Configuration
01:29
Configuration Management Set-up
05:58
Applying Configuration - Codebase (Part 1)
08:42
Source Code - Configuration
00:07
+ (Bonus) Front-end Application
1 lecture 06:37
Front-end Application Set-up (Development Mode)
06:37
+ (Bonus) Deployment - Amazon Web Services (AWS)
10 lectures 22:48
Signing up to Amazon Web Services and signing up
01:01
Amazon S3: Setting up a Bucket (Front-end Hosting)
04:50
Enabling CORS from the S3 Front-end Application
03:02
IMPORTANT: bcryptjs NPM package
00:18
TIP: Before Deploying to Production
00:27
Pre-production package.json Adjustments
01:37
IMPORTANT: Change in TypeORM Configuration
00:27
Deploying NestJS to Elastic Beanstalk
07:45
Uploading the Front-end App to S3
03:12
Source Code - Deployment
00:07
Requirements
  • Having a basic understanding of JavaScript and/or NodeJS
  • Having basic knowledge of TypeScript is recommended, but not required
Description

NestJS is a Node.js back-end development framework built upon Express, leveraging the power of TypeScript.

NestJS leverages the incredible popularity and robustness of JavaScript as a language and Node.js as a technology. It is inspired by common libraries and frameworks such as Angular, React and Vue which improve developer productivity and experience.

Even considering the amount of superb libraries, helpers and tools that exist for server-side Node.js, none of them effectively solve the main problem - the architecture of an application.

NestJS provides an out-of-the-box application architecture which allows developers and teams to create highly testable, scalable, loosely coupled and easily maintainable applications.


Recently, the NestJS framework is gaining extreme popularity due to its incredible features;

  • Leverages TypeScript - strongly typed language which is a super-set of JavaScript

  • Simple to use, easy to learn and easy to master

  • Powerful Command Line Interface (CLI) tool that boosts productivity and ease of development

  • Detailed, well-maintained documentation

  • Active codebase development and maintenance

  • Open-source (MIT license)

  • Supports dozens nest-specific modules that help you easily integrate with common technologies and concepts such as TypeORM, Mongoose, GraphQL, Logging, Validation, Caching, Websockets and much more

  • Easy of unit-testing applications

  • Made for Monoliths and Micro-services (entire section in the documentation regarding the Microservice type of a NestJS application, as well as techniques and recipes).

In this course I am going to guide you through the process of planning, developing and deploying a fully-featured back-end application, based on my experience developing and maintaining systems that support dozens of millions of concurrent users at scale.

Who this course is for:
  • Intermediate JavaScript developers who want to dive into back-end development
  • Any developers willing to apply TypeScript on the back-end
  • Developers eager to learn how to develop performant, secure and production-ready REST APIs following best practices
  • Developers who want to learn how to deploy their application to the cloud (Amazon Web Services)
  • Developers who want to follow building a practical, real-world application from zero to production