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 | 8.5 Hours | 3.62 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
  • Using GraphQL with NestJS
  • Database persistence with MongoDB
Table of Contents

Introduction to NestJS & Pre-requisites
Welcome to the course!
Thank you + Future Content
What is NestJS
Installing the NestJS CLI

REST API – Task Management Application (CRUD)
Project Overview Task Management Application
Defining a Task Model
Feature Creating a Task (Part 1 Service)
Feature Creating a Task (Part 2 Controller)
Introduction to Data Transfer Objects (DTOs)
Creating a CreateTaskDto
Feature Getting a Task by ID
Challenge Deleting a Task
Solution Deleting a Task
Challenge Updating a Task’s Status
Solution Updating a Task’s Status
Creating a project via the CLI and an introduction to a NestJS project structure
Feature Searching and Filtering Tasks
Introduction to NestJS Modules
Creating a Tasks Module
Introduction to NestJS Controllers
Creating a Tasks Controller
Introduction to NestJS Providers and Services
Creating a Tasks Service
Feature Getting all Tasks

Validation and Error Handling
Introduction to NestJS Pipes
ValidationPipe Creating a Task
Error Handling Getting a non-existing Task
Error Handling Deleting a non-existing Task
Custom Pipe Validating the Task Status
ValidationPipe Task Filtering and Search

Data Persistence – PostgreSQL & TypeORM
Using pgAdmin to create a Database
Solution Delete Task Persistence
Persistence Updating Task Status
IMPORTANT Before Persistence of Getting Tasks
Persistence Getting Tasks (with or without filters)
Introduction to Object Relational Mapping and TypeORM
Connecting NestJS to a database using TypeORM
Creating a Task Entity
Creating a Task Repository
Preparation for Task Service Refactoring
Persistence Getting a Task by ID
Persistence Creating a Task
Challenge Delete Task Persistence

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

(Part 2) Authorization – Task Ownership
Tasks and Users – Database Relation
Authorization Creating a Task For User
Authorization Getting Tasks For User
Authorization Getting a User’s Task
Authorization Updating a User’s Task Status
Authorization Deleting a User’s Task

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

(Bonus) Pro-Production Configuration
Introduction to Configuration
Configuration Management Set-up
Applying Configuration – Codebase (Part 1)

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

(Bonus) Deployment – Amazon Web Services (AWS)
Amazon S3 Setting up a Bucket (Front-end Hosting)
Enabling CORS from the S3 Front-end Application
Pre-production package.json Adjustments
Deploying NestJS to Elastic Beanstalk
Uploading the Front-end App to S3

(Bonus) Testing a NestJS Application
Unit Testing Crash Course – Basics
Testing JwtStrategy
Unit Testing Crash Course – First Tests
Testing TasksService – Part 1 – getTasks
Testing TasksService – Part 2 – getTaskById
(Challenge) Testing TasksService – Part 3 – createTask
Testing TasksService – Part 4 – deleteTask
(Challenge) Testing TasksService – Part 5 – updateTaskStatus
Testing UserRepository
Testing User Entity

GraphQL + MongoDB
GraphQL + MongoDB Section Introduction
Using the GraphQL Playground
Persistence TypeORM, MongoDB and our Lesson Entity
LessonService and createLesson method
Create Lesson GraphQL Mutation
getLesson GraphQL Query with MongoDB
Validation Create Lesson Input
Challenge Get All Lessons GraphQL Query
Creating the Student Module
Challenge Defining the Student Entity
Challenge Create Student Mutation
Project Overview School Management
Challenge Get All Students GraphQL Query
Challenge Get Student by ID Query
Assign Students To Lesson GraphQL Mutation
Improvement Assign Students Upon Lesson Creation
Resolve students Field in Lesson
Robo 3T – Connecting to the MongoDB Database
Ensure NestJS 7 Installation
Project setup
Installing GraphQL Dependencies
Creating the Lesson Module
Defining the Lesson GraphQL Type
Creating the Lesson Resolver