NestJS Zero to Hero – Modern TypeScript Back-end Development

NestJS Zero to Hero – Modern TypeScript Back-end Development

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 15.5 Hours | 6.55 GB

Develop and deploy enterprise back-end applications following best practices using Node.js and TypeScript

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.

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
Table of Contents

Introduction to NestJS & Pre-requisites
1 Welcome to the course!
2 Installing the NestJS CLI
3 (Optional) Installing VSCode and Extensions
4 Installing Node.js and Yarn
5 NEW COURSE VERSION LIVE (JUNE 2021)

Task Management Application (REST API)
6 Project Overview
7 Creating our project via the NestJS CLI
8 NestJS Project Structure
9 Introduction to NestJS Modules
10 Creating a Tasks Module
11 Introduction to NestJS Controllers
12 Creating at Tasks Controller
13 Introduction to NestJS Providers and Services
14 Creating a Tasks Service
15 Feature Getting All Tasks
16 Creating a Postman Collection
17 Defining a Task Model
18 Feature Creating a Task (Part 1 – Controller)
19 Feature Creating a Task (Part 2 – Service)
20 Intro to Data Transfer Objects (DTO)
21 Implementing CreateTaskDto
22 Feature Getting a Task by ID
23 Challenge Deleting a Task
24 Solution Deleting a Task
25 Challenge Update Task Status
26 Solution Update Task Status
27 Feature Searching and Filtering
28 Installing Postman
29 Section Code

Validation and Error Handling
30 Introduction to NestJS Pipes
31 ValidationPipe Creating a Task
32 Error Handling Getting a non-existing Task
33 Error Handling Deleting a non-existing Task
34 Validation Update Task Status
35 Challenge Validating Task Filtering and Search
36 Section Code

Data Persistence – PostgreSQL and TypeORM
37 Introduction to Persistence
38 Running PostgreSQL via Docker
39 Setting up pgAdmin
40 Creating a Database using pgAdmin
41 Introduction to TypeORM
42 Setting up a Database Connection
43 Creating a Task Entity
44 Active Record VS Data Mapper Patterns
45 Creating a Tasks Repository
46 Refactoring for Tasks Service
47 Persistence Getting a Task by ID
48 Persistence Creating a Task
49 (Challenge) Persistence Deleting a Task
50 (Solution) Persistence Deleting a Task
51 Persistence Update Task Status
52 Small Change Needed
53 Persistence Getting All Tasks
54 Installing Docker and pgAdmin
55 Section Code

Auth Part 1 – Authentication
56 Intro to Authentication and Authorization
57 Setting up AuthModule, User Entity and User Repository
58 Feature Signing Up
59 Validation Credentials and Password Strength
60 Error Handling Username Conflicts
61 Securely Storing Passwords
62 Password Hashing With Bcrypt
63 Feature Signing In
64 Intro to JSON Web Tokens (JWT)
65 Setting up the JWT Module and Passport.js
66 Signing a JWT Token on Sign In (Authentication)
67 Implementing JWT Validation
68 Custom @GetUser Decorator
69 Guarding the Tasks Routes
70 Section Code

Auth Part 2 – Task Ownership and Restrictions
71 Tasks and Users – Database Relation
72 Make Users Own Tasks
73 Serialize User Data
74 Restricting Getting All Tasks
75 BUG FIX Getting All Tasks
76 Restricting Getting a Task By ID
77 Restricting Status Updates
78 Restricting Deleting A Task
79 Section Code

THANK YOU!
80 THANK YOU! (+ Promotion)

(Bonus) Logging
81 Introduction to Logging
82 Implementing Logs in our NestJS app
83 Section Code

(Bonus) Configuration Management
84 Introduction to Configuration
85 Quick Intro to Environment Variables
86 Setting up ConfigModule
87 TypeORM Configuration
88 Config Schema Validation
89 JWT Secret Configuration
90 Section Code
91 Windows Environment Variables

(Bonus) Front-end Application
92 Front-end Application
93 Section Code

(Bonus) Deployment
94 Signing up to Heroku
95 Creating a Heroku Application
96 Installing the the Heroku CLI
97 Postgres on Heroku
98 Changes in our NestJS App
99 Deploying NestJS to Heroku
100 Deploying Front-end to GitHub Pages
101 DISCLAIMER Potential Costs
102 Section Code

(Bonus) Unit Testing
103 Unit Testing Crash Course Basics
104 Unit Testing Crash Course First Tests
105 IMPORTANT Fixing import paths
106 Testing TasksService – Part 1
107 Testing TasksService – Part 2
108 Section Code

GraphQL + MongoDB
109 GraphQL + MongoDB Section Introduction
110 Project Overview School Management
111 Robo 3T – Connecting to the MongoDB Database
112 Project setup
113 Ensure NestJS 7 Installation
114 Installing GraphQL Dependencies
115 Creating the Lesson Module
116 Defining the Lesson GraphQL Type
117 Creating the Lesson Resolver
118 Using the GraphQL Playground
119 Persistence TypeORM, MongoDB and our Lesson Entity
120 LessonService and createLesson method
121 Create Lesson GraphQL Mutation
122 getLesson GraphQL Query with MongoDB
123 Validation Create Lesson Input
124 Challenge Get All Lessons GraphQL Query
125 Creating the Student Module
126 Challenge Defining the Student Entity
127 Challenge Create Student Mutation
128 Challenge Get All Students GraphQL Query
129 Challenge Get Student by ID Query
130 Assign Students To Lesson GraphQL Mutation
131 Improvement Assign Students Upon Lesson Creation
132 Resolve students Field in Lesson
133 Additional Resources GraphQL
134 IMPORTANT! GraphQL installation version
135 MongoDB Installation
136 Section Code

(OLD) Introduction to NestJS & Pre-requisites
137 (Optional) Installing Visual Studio Code
138 Welcome to the course!
139 What is NestJS
140 Installing the NestJS CLI
141 Installing Node.js and NPM
142 Installing Node.js and Yarn
143 Installing Postman
144 Installing Yarn
145 NEW COURSE VERSION LIVE (JUNE 2021)
146 OLD COURSE CONTENT

(OLD) REST API – Task Management Application (CRUD)
147 Project Overview Task Management Application
148 Creating a project via the CLI and an introduction to a NestJS project structure
149 Introduction to NestJS Modules
150 Creating a Tasks Module
151 Introduction to NestJS Controllers
152 Creating a Tasks Controller
153 Introduction to NestJS Providers and Services
154 Creating a Tasks Service
155 Feature Getting all Tasks
156 Defining a Task Model
157 Feature Creating a Task (Part 1 Service)
158 NOTE Imprting UUID in the next lecture
159 project-overview-edited

(OLD) Data Persistence – PostgreSQL & TypeORM
160 Feature Creating a Task (Part 2 Controller)
161 Introduction to Data Transfer Objects (DTOs)
162 Creating a CreateTaskDto
163 Feature Getting a Task by ID
164 Challenge Deleting a Task
165 Solution Deleting a Task
166 Challenge Updating a Task’s Status
167 Solution Updating a Task’s Status
168 Feature Searching and Filtering Tasks
169 NEW COURSE + DISCOUNT COUPON

(OLD) Validation and Error Handling
170 Introduction to NestJS Pipes
171 ValidationPipe Creating a Task
172 Error Handling Getting a non-existing Task
173 Error Handling Deleting a non-existing Task
174 Custom Pipe Validating the Task Status
175 ValidationPipe Task Filtering and Search
176 Using pgAdmin to create a Database
177 Introduction to Object Relational Mapping and TypeORM
178 Connecting NestJS to a database using TypeORM
179 Creating a Task Entity
180 Creating a Task Repository
181 Preparation for Task Service Refactoring
182 Persistence Getting a Task by ID
183 Persistence Creating a Task
184 Challenge Delete Task Persistence
185 Solution Delete Task Persistence
186 Persistence Updating Task Status
187 IMPORTANT Before Persistence of Getting Tasks
188 Persistence Getting Tasks (with or without filters)
189 IMPORTANT TypeORM Entities Configuration
190 Installing PostgreSQL and pgAdmin
191 Section Code
192 Source Code – Data Persistence
193 Source Code – Validation and Error Handling

(OLD) (Part 1) Authentication – Setting up JWTPassport.js
194 Setting up AuthModule, User Entity and UserRepository
195 Feature Sign Up
196 Validation AuthCredentialsDto, password strength
197 Error Handling Duplicate Usernames
198 Security Hashing Passwords & Using Salts
199 Feature Validating Password – Sign In
200 Introduction to JSON Web Tokens (JWT)
201 Setting up the JWT Module and Passport.js
202 Signing a JWT Token Upon Authentication
203 Setting up the JWT Strategy for Authorization
204 Custom @GetUser() Decorator
205 Guarding the Tasks Routes (TasksController)
206 feature-sign-up
207 IMPORTANT GetUser Decorator

(OLD) (Part 2) Authorization – Task Ownership
208 Tasks and Users – Database Relation
209 Authorization Creating a Task For User
210 Authorization Getting Tasks For User
211 Authorization Getting a User’s Task
212 Authorization Updating a User’s Task Status
213 Authorization Deleting a User’s Task
214 Source Code – Authentication & Authorization

(OLD) (Bonus) Logging
215 Introduction to Logging
216 Applying logging in our application
217 Section Code

(OLD) (Bonus) Pro-Production Configuration
218 Introduction to Configuration
219 Configuration Management Set-up
220 Applying Configuration – Codebase (Part 1)
221 Source Code – Configuration
222 Windows Environment Variables

(OLD) (Bonus) Front-end Application
223 Front-end Application Set-up (Development Mode)
224 Section Code

(OLD) (Bonus) Deployment – Amazon Web Services (AWS)
225 Amazon S3 Setting up a Bucket (Front-end Hosting)
226 Enabling CORS from the S3 Front-end Application
227 Pre-production package.json Adjustments
228 Deploying NestJS to Elastic Beanstalk
229 Uploading the Front-end App to S3
230 DISCLAIMER Potential Costs
231 IMPORTANT bcryptjs NPM package
232 IMPORTANT Change in TypeORM Configuration
233 index
234 pre-prod-packagejson-changes
235 Section Code
236 Signing up to Amazon Web Services and signing up
237 Source Code – Deployment
238 TIP Before Deploying to Production

(OLD) (Bonus) Testing a NestJS Application
239 Unit Testing Crash Course – Basics
240 Unit Testing Crash Course – First Tests
241 Testing TasksService – Part 1 – getTasks
242 Testing TasksService – Part 2 – getTaskById
243 (Challenge) Testing TasksService – Part 3 – createTask
244 Testing TasksService – Part 4 – deleteTask
245 (Challenge) Testing TasksService – Part 5 – updateTaskStatus
246 Testing UserRepository
247 Testing User Entity
248 Testing JwtStrategy
249 Domain Names for AWS Applications
250 Source Code – Testing
251 Testing Final Words

Homepage