NestJS Zero to Hero – Modern TypeScript Back-end Development

NestJS Zero to Hero – Modern TypeScript Back-end Development
NestJS Zero to Hero – Modern TypeScript Back-end Development
English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 6.5 Hours | 3.30 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 JSON Web Tokens (JWT)
  • Unit testing NestJS applications
Table of Contents

1 Introduction to NestJS & Pre-requisites
2 Welcome to the course!
3 What is NestJS?
4 Installing Node.js and NPM
5 Installing the NestJS CLI
6 Installing Postman
7 (Optional) Installing Visual Studio Code

REST API – Task Management Application (CRUD)
8 Project Overview: Task Management Application
9 Creating a project via the CLI and an introduction to a NestJS project structure
10 Introduction to NestJS Modules
11 Creating a Tasks Module
12 Introduction to NestJS Controllers
13 Creating a Tasks Controller
14 Introduction to NestJS Providers and Services
15 Creating a Tasks Service
16 Feature: Getting all Tasks
17 Defining a Task Model
18 Feature: Creating a Task (Part 1: Service)
19 Feature: Creating a Task (Part 2: Controller)
20 Introduction to Data Transfer Objects (DTOs)
21 Creating a CreateTaskDto
22 Feature: Getting a Task by ID
23 Challenge: Deleting a Task
24 Solution: Deleting a Task
25 Challenge: Updating a Task’s Status
26 Solution: Updating a Task’s Status
27 Feature: Searching and Filtering Tasks

Validation and Error Handling
28 Introduction to NestJS Pipes
29 ValidationPipe: Creating a Task
30 Error Handling: Getting a non-existing Task
31 Error Handling: Deleting a non-existing Task
32 Custom Pipe: Validating the Task Status
33 ValidationPipe: Task Filtering and Search
34 Source Code – Validation and Error Handling

Data Persistence – PostgreSQL & TypeORM
35 Installing PostgreSQL and pgAdmin
36 Using pgAdmin to create a Database
37 Introduction to Object Relational Mapping and TypeORM
38 IMPORTANT: TypeORM Entities Configuration
39 Connecting NestJS to a database using TypeORM
40 Creating a Task Entity
41 Creating a Task Repository
42 Preparation for Task Service Refactoring
43 Persistence: Getting a Task by ID
44 Persistence: Creating a Task
45 Challenge: Delete Task Persistence
46 Solution: Delete Task Persistence
47 Persistence: Updating Task Status
48 IMPORTANT: Before Persistence of Getting Tasks
49 Persistence: Getting Tasks (with or without filters)
50 Source Code – Data Persistence

(Part 1) Authentication – Setting up JWT/Passport.js
51 Setting up AuthModule, User Entity and UserRepository
52 Feature: Sign Up
53 Validation: AuthCredentialsDto, password strength
54 Error Handling: Duplicate Usernames
55 Security: Hashing Passwords & Using Salts
56 Feature: Validating Password – Sign In
57 Introduction to JSON Web Tokens (JWT)
58 Setting up the JWT Module and Passport.js
59 Signing a JWT Token Upon Authentication
60 Setting up the JWT Strategy for Authorization
61 Custom @GetUser() Decorator
62 Guarding the Tasks Routes (TasksController)

(Part 2) Authorization – Task Ownership
63 Tasks and Users – Database Relation
64 Authorization: Creating a Task For User
65 Authorization: Getting Tasks For User
66 Authorization: Getting a User’s Task
67 Authorization: Updating a User’s Task Status
68 Authorization: Deleting a User’s Task

(Bonus) Logging
69 Introduction to Logging
70 Applying logging in our application

(Bonus) Pro-Production: Configuration
71 Windows: Environment Variables
72 Introduction to Configuration
73 Configuration Management Set-up
74 Applying Configuration – Codebase (Part 1)
75 Source Code – Configuration

(Bonus) Front-end Application
76 Front-end Application Set-up (Development Mode)

(Bonus) Deployment – Amazon Web Services (AWS)
77 Signing up to Amazon Web Services and signing up
78 Amazon S3: Setting up a Bucket (Front-end Hosting)
79 Enabling CORS from the S3 Front-end Application
80 IMPORTANT: bcryptjs NPM package
81 TIP: Before Deploying to Production
82 Pre-production package.json Adjustments
83 IMPORTANT: Change in TypeORM Configuration
84 Deploying NestJS to Elastic Beanstalk
85 Uploading the Front-end App to S3
86 Source Code – Deployment

(Bonus) Testing a NestJS Application
87 Unit Testing Crash Course – Basics
88 Unit Testing Crash Course – First Tests
89 Testing TasksService – Part 1 – getTasks
90 Testing TasksService – Part 2 – getTaskById
91 (Challenge) Testing TasksService – Part 3 – createTask
92 Testing TasksService – Part 4 – deleteTask
93 (Challenge) Testing TasksService – Part 5 – updateTaskStatus
94 Testing UserRepository
95 Testing User Entity
96 Testing JwtStrategy
97 Testing Final Words
98 Source Code – Testing

Bonus Material
99 HTTPS – Secure Communication
100 Proceeding with NestJS & Back-end Development
101 Domain Names for AWS Applications
102 Elastic Beanstalk CLI