Tom Ray/Learn NestJS By Building Projects

  • $79

Learn NestJS By Building Projects

  • Course
  • 61 Lessons

An immersive, hands-on course where you'll learn NestJS by building real-world projects from scratch, covering NestJS concepts and best practices.

Contents

👋 Welcome!

Get ready to start your NestJS mastery journey.

Through various projects, you'll learn the following techniques and concepts:

  • Building a REST API with full CRUD functionality using NestJS Controllers, Middleware & Pipes

  • Authentication, Authorization, Guards & Sessions

  • Persisting data to a database and cache

  • Processing jobs in a queue

  • Unit testing, integration testing and end-to-end testing

  • Realtime app using Websockets

  • Fullstack monorepo

  • All projects will include deployment

👋 Read me!
    Preview

    Project 1: Random Emoji Generator API

    There are many NestJS tools at your disposal when building an application, specifically:

    • Middleware

    • Guards

    • Interceptors

    • Pipes

    • Exception Filters

    • Decorators

    In this project, we’re going to explore the purpose of these tools, how they fit together and the order of their execution in the NestJS lifecycle by building a random emoji generator API.

    With this understanding, you’ll have an excellent foundation for building NestJS applications for the projects ahead.

    Introduction & project preview
    • 3 mins
    • 10.2 MB
    Preview
    Project pre-requisites & set up
    • 8 mins
    • 19.2 MB
    The NestJS lifecycle
    • 9 mins
    • 63.3 MB
    Middleware
    • 8 mins
    • 35.9 MB
    Guards
    • 20 mins
    • 103 MB
    Interceptors (before handlers)
    • 11 mins
    • 55.5 MB
    Pipes
    • 18 mins
    • 99.1 MB
    Route handlers
    • 7 mins
    • 52.7 MB
    Interceptors (after handlers)
    • 9 mins
    • 27.3 MB
    Exception filters
    • 19 mins
    • 69.7 MB
    Dependency Injection
    • 15 mins
    • 129 MB
    E2e testing
    • 29 mins
    • 262 MB
    CI/CD set up with Github Actions
    • 13 mins
    • 87.9 MB
    Deployment with Railway
    • 14 mins
    • 92.4 MB

    Project 2: The Ultimate NestJS Starter

    The starter repos will also serve as excellent NestJS starter repos for any future projects you start outside of the course!

    Here’s what’s included in the starter repos:

    • Adding to the tsconfig.json file

    • Setting up the ConfigModule and environment variables for Jest

    • Enforcing consistent HTTP response structure

    • Configuring some basic HTTP security

    • Adding whitelisted validation to the NestJS server

    • Setting up NestJS logging

    • Docker compose set up for a Postgres database & Redis

    • Prisma setup (the ORM we’ll be using in each project to interact with the database)

    • Redis and CacheService setup

    • Jest config (including env variables)

    • Setting up a CI Pipeline using Github Actions

    Introduction & project preview
    • 6 mins
    • 41.2 MB
    Preview
    Project set up
    • 7 mins
    • 17 MB
    Adding a Core module with ConfigModule set up
    • 16 mins
    • 51.6 MB
    Using an interceptor to enforce a consistent HTTP response structure
    • 14 mins
    • 131 MB
    Security considerations (Helmet & validation pipes)
    • 16 mins
    • 146 MB
    Setting up a custom Logger
    • 45 mins
    • 161 MB
    Docker Compose set up for Postgres & Redis
    • 13 mins
    • 59.3 MB
    Interacting with the database (using Prisma)
    • 27 mins
    • 60.7 MB
    Interacting with the cache (using Redis)
    • 22 mins
    • 202 MB
    Unit testing
    • 28 mins
    • 88.5 MB
    Integration & e2e testing
    • 60 mins
    • 1.62 GB
    Setting up the CI/CD pipeline
    • 11 mins
    • 86.9 MB
    Deployment (with Railway)
    • 11 mins
    • 25.4 MB

    Project 3: URL Shortener API

    We’re going to build a URL shortening API that’s meant to be used as an internal tool for the company you work for.

    E.g. Imagine you work for a startup and you need a URL shortening tool, and you decide to build one instead of paying for an existing solution.

    Topics covered:

    • REST endpoints with CRUD functionality

    • Paginating and filtering a GET request that returns a list

    • Validation with DTOs and pipes

    • Persisting data to a database

    • Basic API key authentication using guards

    • Using the config module

    • Unit testing, integration testing and end-to-end testing

    Introduction & project preview
    • 4 mins
    • 19.3 MB
    Preview
    Project set up
    • 7 mins
    • 53.4 MB
    Adding the CRUD endpoints
    • 11 mins
    • 97.5 MB
    Business logic: creating a shortened URL
    • 41 mins
    • 371 MB
    Business logic: redirecting a short URL
    • 32 mins
    • 307 MB
    Business logic: Updating and deleting a short URL
    • 8 mins
    • 74.2 MB
    Business logic: return list of saved short URLs
    • 50 mins
    • 440 MB
    API key authentication
    • 18 mins
    • 160 MB
    Unit testing
    • 56 mins
    • 219 MB
    Integration testing
    • 10 mins
    • 79 MB
    E2e testing
    • 18 mins
    • 152 MB
    Deployment (with Railway)
    • 19 mins
    • 41.4 MB

    Project 4: Real estate listings (using queues)

    We’re going to build a real-estate API that allows you to create real estate listings with photos. The photos are added to a queue for processing in the background (where we’ll upload the file to Google Cloud Storage and store the public image url in the database).

    Here are the topics and features we’ll cover in this project:

    • Handling and validating file uploads

    • Sending files to a queue as jobs

    • Processing the jobs in the background

    • Viewing the queue jobs in a UI

    • Using Google Cloud Storage to store the files

    • Validation with DTOs and pipes

    • Unit testing, integration testing and end-to-end testing

    Introduction & project preview
    • 3 mins
    • 17.6 MB
    Preview
    Project set up
    • 7 mins
    • 57.7 MB
    Add logic for creating new real estate listings
    • 21 mins
    • 66 MB
    Attach image files to HTTP request
    • 33 mins
    • 312 MB
    Setting up the queue with Bull
    • 41 mins
    • 381 MB
    Visualise the queue with Bull Board
    • 8 mins
    • 64.3 MB
    Sending files to the queue for processing
    • 23 mins
    • 75.2 MB
    Uploading the file to Google Cloud Storage
    • 34 mins
    • 316 MB
    Storing a reference to the GCP image
    • 11 mins
    • 106 MB
    Unit testing
    • 25 mins
    • 264 MB
    Integration testing
    • 25 mins
    • 249 MB
    E2E testing
    • 19 mins
    • 179 MB
    Deployment (with Railway)
    • 15 mins
    • 40.5 MB

    Project 5: Slack Clone

    In this project, we'll be building a basic Slack clone.

    We'll use a monorepo setup, with NestJS powering the API and backend capabilities, and NextJS used as the frontend.

    Specifically, this project will cover:

    • Setting up a monorepo with NestJS & NextJS

    • Implementing Google Authentication

    • Implementing browser sessions and refresh tokens

    • Setting up a Websocket server

    ⚠️ A few things worth noting:

    • As this course is NestJS focused, I'm not going to cover much on the frontend. If you get stuck on the frontend, you can check out the Github repo for this project.

    • Due to the size of this project (it's a big one) and the fact that testing has been covered extensively in other projects, testing is not covered in this project

    Introduction & project preview
    • 4 mins
    • 10.7 MB
    Preview
    Monorepo setup
    • 20 mins
    • 124 MB
    Frontend setup
    • 7 mins
    • 43.1 MB
    Authentication with Google
    • 22 mins
    • 176 MB
    Implementing browser sessions with refresh tokens
    • 37 mins
    • 236 MB
    Fetching the initial state with HTTP
    • 10 mins
    • 58.5 MB
    Implementing a Websocket client & server
    • 17 mins
    • 131 MB
    Deployment (with Railway)
    • 14 mins
    • 80.3 MB