Nest.js Crash Course : A Comprehensive Step-by-Step Tutorial
Вставка
- Опубліковано 11 лип 2024
- ❤️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
I recommend anyone who has just started learning NextJS for the first time, This video is better than everyone else
wow, thst was a nice one 🌷🌷🌷. it really encourages me to move forward. thanks.
It's NestJS. Not NextJS
@@minhtetoo80 I recommend anyone who has just started learning NestJS for the first time, This video is better than everyone else
Thanks for the review. This was the first video Google recommended to me.
agreed ,after 27 minutes into the video, btw its nest js and not next js
Amazing steps to next js.. pls make huge playlists by creating large application with Nest js and angular 🎉
Thank you so much for a step-by-step explanation.
thanks. I am very glad it was helpful for you 🌷🌷
This was a brilliant video. Using docker was a nice touch. thanks for this. Look forward to the authentication video
Thanks, 🙏 🌹, I am really glad it was helpful for you. Actually I have created a video for authentication in nest.js : ua-cam.com/video/twaUdKr06kA/v-deo.html
This channel is sick. Thank man!
Hi, Is that a complement? 😂
Awesome. Thank you so much for crash course video and you explain so clear.
thanks 🌷
Nice work man. You're the best!!
Thanks you so much 🙏💖
very helpful course.. please make more detailed videos on Nest Js
Amazing tutorial. Thank you for sharing
Thanks 🙏
Thanks for sharing, one of the best crash course regarding NestJs
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 🌷🌷
very good video. keep up the good works.
Thank you for sharing your positive comment 🌷🌷
great video
Perfect Video
Glad you think so!
Good !
Thanks 🙏
Good video and explanation
Thanks 🌷
Good job! Will your next video for nests +prisms tutorial
It's a useful crash course of Nestjs whether For Recap Or Learning.
🙏🙏🙏
thanks so much 谢谢 :
Your welcome 🙏🌹
Great tutorial! I would like your opinion on using Prisma over Typeorm ? Looking forward for future videos like this!
Hi, Thanks 🙏🙏. Well, I think, since Prisma uses objects instead of class instances for returning data, It might be faster in data intensive apps.
Thank you so much. Can u make more video about Nest?
Nice 👍 .
that's was nice video thanks
Glad you liked it!
Amazing tutorial… thanks a lot 🔥🔥🔥💯 can you create some real project with this tools please?
thanks
You're welcome! 🌷
what a cool tutorial, i wonder if you have a tutorial setting up cicd for your nest app to aws ?
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
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.
yes, thanks for your tip. if you want to use local postgres, just create testDB, manually.
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.
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
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 .
Yeah I will put it on my list.
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?
Please double check your pass. And if it did not work, share your code in github, I will take look at it.
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?
Yeah it's really awesome
It is my stack.
@@SakuraDev will you create a video about that in the future? maybe with drizzle too
@@_codesan Yes I put it on my list. It is a good idea.
1 project on nest js plz
hi, I have created a new one: ua-cam.com/video/khNwrFJ-Xqs/v-deo.html
@@SakuraDev oh my god I was looking for this you made it.. Millions of thanks ❤ dear for your effort for us
@@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.