Hello and welcome everyone welcome to my another crash course and in this crash course we are talking about nest js okay so nest js is something new we can say but it is getting more popular and when you are writing node.js api backend then i will advise you to use nest js to take lot of advantage from it okay so in this video we are just getting started with nest js we will just discuss why you should use nest js today for your api backend i mean whatever kind of backend you are writing with the node js everything is possible with nest js okay so around that we will talk today so i will just give you a basic introduction okay this is my youtube channel and i am publishing a lot of courses which are totally free you don't need to pay for anything I'm covering the full width of the course like from beginner to intermediate to advanced level so you don't need to pay on any learning website it's a free learning I'm providing the github source where you can find the individual module code and a proper course content in particular link okay so first of all why do we need nest js okay You might be thinking that nest js is somewhat like okay we have a coa, happy js, restify, express. Now nest js is something new right? Yes it is totally new but it is not somewhat like you have heard about happy js, coa, restify, express. In today's world we are writing javascript with the typescript right.
So if we just look at the typescript support for all these other modules coa, happy, restify. they are not providing they are just a minimal framework on top of node.js they are helping you to write rest endpoints helping you to create a http server like express server using express server or happy server or kuva server you are creating right so those are minimal but nest.js is something totally different it is supporting typescript and it is giving you the well-defined TypeScript modular structure if you have gone through the angular then an in angular I'm talking about angular 9 10 or angular angular version greater than 2.0 there we are creating the different modules defining the dependencies creating the controller services all these things we are doing right so same part of things we will be doing in nest.js so this nest.js is actually you can see it's derived from AngularJS design. Sorry, not AngularJS. We are calling that Angular because AngularJS is 1.x.
Angular is whatever is coming after 2.0. Currently, we are using Angular 10. So, in Angular also, we are creating the modules, ng modules, then creating services, creating components, injecting services inside a component. Same kind of structure you will see in SGS for API backend, not for frontend.
So, if you already know Angular, then it will be very easy to get started with nest.js for writing api backend or any backend system in node.js it is fully compatible with the typescript and it is providing the support with typo rm and sqlize to write data to the backends like mysql postgres or any other database okay so this course is divided into many sections not only five sections in first section we will talk about basic getting started with nasdaq-cli Then we will write a REST API backend. We will do the validation of request object with the DTOs. Then we will talk about the different building blocks which NestJS is providing us.
Why NestJS is different from these minimal framework? Because NestJS is giving you the well-defined structure for everything. You need request validation, let's have pipes.
You want a filtering, you want interceptors for your exceptions, you can use interceptors. you want middleware okay you have a middleware from nasdaq all controllers services middleware filters pipes all these are actually well defined building blocks which you can plug in with your modules either you can plug in at a global level or at a module level everything can be a module database module logger module swagger module user module okay blog module all these modules can have their own controller services pipes all these things can be separated so it is giving us the well-defined structure that we will see in the code we will talk about data persistence with a my sequel or typo RM like we can use equalize type orm and then Next.js provides support to talk to mongodb using next.js mongoose, next.js mysql, all these modules Next.js typeorm, next.js sqlite, all these modules are there. Finally, we will be building lot of applications here.
We will talk about how we can create a simple auth. API is using passport, authentication, authorization. We will talk about logging in the next.js. Managing configurations, so we are using database configurations.
process level configuration like port log level database username password blah blah Redis username password username password host and put all this configuration how you can maintain apart from that we will talk about nest GS with a GraphQL and rest api's okay next year's with the different micro services next year's Redis next year's socket IO okay all these things will be covered so it is like a full-fledged course and what you need is just some Postman tool will be fine. You should have a node.js installed simple editor vs code should be fine docker we may need in future videos Just a github account so that whatever code i'm giving you can clone it and know all right and basic knowledge of node.js Coming back to my point. Why do we need nest.js? Don't consider nas.js is a simple framework nas.js is getting very much popular And when you start using nest.js, you learn the very basics after that you can write Node.js backend systems easily. What you need to understand is the basic skeleton of NestJS, how it works.
You are creating modules, controllers and services. Controllers will have your routes, services will talk to your database, give the data to the controllers. Controllers will expose that data to different API endpoints.
NestJS is very rich when it comes to the modules and all because what you can do is you can use Swagger module to expose the API stack. you don't need to write yml file you can use nasdaq redis to use the redis module you can use nasdaq mongoose nasdaq typo rm nasdaq graphql to introduce graphql okay so let's start our journey i think and we will we will start with nasdaq cli how to just install it how to get started create a base