❤️Please Support me by subscribing to my channel 👉🏻https://www.youtube.com/@sakuradev?sub_confirmation=1
Welcome to this comprehensive Nest.js crash course, where we will explore the fundamentals of building scalable server-side applications using Node.js and TypeScript. In this tutorial, we'll start with the basics of Nest.js, including its architecture, modules, controllers, and services.
Then, we'll go deeper into controllers and services, learning how to handle requests and responses from clients and create reusable business logic, respectively. We'll also cover modules, how they organize our code, and make it more modular.
Next, we'll dive into connecting to a PostgreSQL database using TypeORM, a powerful Object Relational Mapper (ORM) that makes database interactions seamless. You'll learn how to set up the database within a docker container, create tables, and query data using TypeORM.
💻 GitHub Repo (don't forget to give it a ⭐): https://github.com/vahid-nejad/nest-crash-course
Content:
0:00 Intro
1:09 Setting up new nest.js project
2:35 Explaining file structure and modules
6:02 Controllers
10:34 Defining the params for API routes
12:45 Accessing to the body of requests
14:24 DTO: Data Transfer Object
17:20 Validation Pipe :How we can validate the body object of a request
21:38 Services and dependency injection
27:38 Injecting (using) a service to another module
32:03 Setting up PostgreSQL DB with docker compose
36:23 Creating entity models with TypeORM
40:04 Defining DB triggers for PostgreSQL with TypeORM
42:19 Configure TypeORM to work with Nest.js
48:24 Creating relationships between entities
57:02 Injecting and using the TypeORM repositories for Entities in services and doing CRUD to DB with ease