Nest.js Crash Course : A Comprehensive Step-by-Step Tutorial
❤️Please Support me by subscribing to my channel 👉🏻www.youtube.com/@sakuradev?su...
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 ⭐): github.com/vahid-nejad/nest-c...
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
Пікірлер: 69
I recommend anyone who has just started learning NextJS for the first time, This video is better than everyone else
@SakuraDev
Жыл бұрын
wow, thst was a nice one 🌷🌷🌷. it really encourages me to move forward. thanks.
@minhtetoo80
Жыл бұрын
It's NestJS. Not NextJS
@azizbek1106
Жыл бұрын
@@minhtetoo80 I recommend anyone who has just started learning NestJS for the first time, This video is better than everyone else
@NobleOsinachi
Жыл бұрын
Thanks for the review. This was the first video Google recommended to me.
@laxmikanthgurram1074
6 ай бұрын
agreed ,after 27 minutes into the video, btw its nest js and not next js
great video
Amazing steps to next js.. pls make huge playlists by creating large application with Nest js and angular 🎉
It's a useful crash course of Nestjs whether For Recap Or Learning.
@SakuraDev
Ай бұрын
🙏🙏🙏
very helpful course.. please make more detailed videos on Nest Js
Thank you so much for a step-by-step explanation.
@SakuraDev
Жыл бұрын
thanks. I am very glad it was helpful for you 🌷🌷
Nice work man. You're the best!!
@SakuraDev
8 ай бұрын
Thanks you so much 🙏💖
This channel is sick. Thank man!
@SakuraDev
Жыл бұрын
Hi, Is that a complement? 😂
Awesome. Thank you so much for crash course video and you explain so clear.
@SakuraDev
Жыл бұрын
thanks 🌷
This was a brilliant video. Using docker was a nice touch. thanks for this. Look forward to the authentication video
@SakuraDev
Жыл бұрын
Thanks, 🙏 🌹, I am really glad it was helpful for you. Actually I have created a video for authentication in nest.js : kzread.info/dash/bejne/pquVt8aEopOcm6Q.html
Amazing tutorial. Thank you for sharing
@SakuraDev
7 ай бұрын
Thanks 🙏
Thanks for sharing, one of the best crash course regarding NestJs
@SakuraDev
Жыл бұрын
Thank you for sharing your positive comment on the NestJS crash course video. I'm glad to hear that you found it helpful and informative 🌷🌷
Good !
@SakuraDev
8 ай бұрын
Thanks 🙏
Perfect Video
@SakuraDev
11 ай бұрын
Glad you think so!
very good video. keep up the good works.
@SakuraDev
Жыл бұрын
Thank you for sharing your positive comment 🌷🌷
Good job! Will your next video for nests +prisms tutorial
thanks so much 谢谢 :
@SakuraDev
11 ай бұрын
Your welcome 🙏🌹
that's was nice video thanks
@SakuraDev
11 ай бұрын
Glad you liked it!
Good video and explanation
@SakuraDev
Жыл бұрын
Thanks 🌷
Amazing tutorial… thanks a lot 🔥🔥🔥💯 can you create some real project with this tools please?
thanks
@SakuraDev
10 ай бұрын
You're welcome! 🌷
Thank you so much. Can u make more video about Nest?
@SakuraDev
Жыл бұрын
Nice 👍 .
Great tutorial! I would like your opinion on using Prisma over Typeorm ? Looking forward for future videos like this!
@SakuraDev
Жыл бұрын
Hi, Thanks 🙏🙏. Well, I think, since Prisma uses objects instead of class instances for returning data, It might be faster in data intensive apps.
what a cool tutorial, i wonder if you have a tutorial setting up cicd for your nest app to aws ?
@SakuraDev
7 ай бұрын
Thanks 🙏. I need to do some research about it
I would really appreciate it if you can do a video about how to dockerize react/next apps
@SakuraDev
Жыл бұрын
Hi, I will do that soon.
🔊 Since OP is using Docker for DB connection, please stop your locally installed postgres, otherwise you would get testDB database does not exist.
@SakuraDev
Жыл бұрын
yes, thanks for your tip. if you want to use local postgres, just create testDB, manually.
@gamedevbrownbus2871
9 ай бұрын
You are a hero, I have been trying to figure out what the problem is and wasted about 1.5 hours before deciding to check out the comment section. You are a life saver.
Hello Sakura can you please make a crash course or something on GraphQl .I have learnt Axios and Fetch Api after that tried to learn Graph Ql but failed miserably as all the stuff is outdated .
@SakuraDev
11 ай бұрын
Yeah I will put it on my list.
I want to plzzzz ask u a question. How can I use NextAuth with Google to authenticate the user and then pass the session to NestJS project to authenticate the user there also so I can use the guards' features in NesfJS. There are no guides or tutorials about this at all
Hi, I am encountering an error while starting the application. [Nest] 608 - 07/30/2023, 1:20:13 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... error: password authentication failed for user "postgres" but the password is correct. Why this happending?
@SakuraDev
11 ай бұрын
Please double check your pass. And if it did not work, share your code in github, I will take look at it.
@imamsutono4530
11 ай бұрын
I have the same issue. So I try @lmessi5924 suggestion to stop the local postgres service, and it works. Hope this help.
it is good to use nestjs as a backend and nextjs as frontend?
@SakuraDev
11 ай бұрын
Yeah it's really awesome
@SakuraDev
11 ай бұрын
It is my stack.
@_codesan
11 ай бұрын
@@SakuraDev will you create a video about that in the future? maybe with drizzle too
@SakuraDev
11 ай бұрын
@@_codesan Yes I put it on my list. It is a good idea.
1 project on nest js plz
@SakuraDev
10 ай бұрын
hi, I have created a new one: kzread.info/dash/bejne/nZyC2dR_epC-odY.html
@pacificview8276
10 ай бұрын
@@SakuraDev oh my god I was looking for this you made it.. Millions of thanks ❤ dear for your effort for us
@SakuraDev
10 ай бұрын
@@pacificview8276 😃😃🙏🙏🙏🙏
Hi , I am getting this error "Cannot use namespace 'PostgresConnectionOptions' as a type.ts(2709) Exported variable 'config' has or is using private name 'PostgresConnectionOptions'.ts(4025)" in ormconfig.ts on this line "const config: PostgresConnectionOptions = {" if i change PostgresConnectionOptions to any it works.