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

  • @azizbek1106
    @azizbek1106 Жыл бұрын

    I recommend anyone who has just started learning NextJS for the first time, This video is better than everyone else

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    wow, thst was a nice one 🌷🌷🌷. it really encourages me to move forward. thanks.

  • @minhtetoo80

    @minhtetoo80

    Жыл бұрын

    It's NestJS. Not NextJS

  • @azizbek1106

    @azizbek1106

    Жыл бұрын

    @@minhtetoo80 I recommend anyone who has just started learning NestJS for the first time, This video is better than everyone else

  • @NobleOsinachi

    @NobleOsinachi

    Жыл бұрын

    Thanks for the review. This was the first video Google recommended to me.

  • @laxmikanthgurram1074

    @laxmikanthgurram1074

    6 ай бұрын

    agreed ,after 27 minutes into the video, btw its nest js and not next js

  • @nimanikoonazar1541
    @nimanikoonazar15413 ай бұрын

    great video

  • @viralmoney8619
    @viralmoney86199 ай бұрын

    Amazing steps to next js.. pls make huge playlists by creating large application with Nest js and angular 🎉

  • @SiavashSol
    @SiavashSolАй бұрын

    It's a useful crash course of Nestjs whether For Recap Or Learning.

  • @SakuraDev

    @SakuraDev

    Ай бұрын

    🙏🙏🙏

  • @rayhankabir6419
    @rayhankabir64195 ай бұрын

    very helpful course.. please make more detailed videos on Nest Js

  • @furkanc6407
    @furkanc6407 Жыл бұрын

    Thank you so much for a step-by-step explanation.

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    thanks. I am very glad it was helpful for you 🌷🌷

  • @ogbuezekiel7400
    @ogbuezekiel74008 ай бұрын

    Nice work man. You're the best!!

  • @SakuraDev

    @SakuraDev

    8 ай бұрын

    Thanks you so much 🙏💖

  • @logistics_guy
    @logistics_guy Жыл бұрын

    This channel is sick. Thank man!

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    Hi, Is that a complement? 😂

  • @kritsana6170
    @kritsana6170 Жыл бұрын

    Awesome. Thank you so much for crash course video and you explain so clear.

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    thanks 🌷

  • @evanskwofie2443
    @evanskwofie2443 Жыл бұрын

    This was a brilliant video. Using docker was a nice touch. thanks for this. Look forward to the authentication video

  • @SakuraDev

    @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

  • @mehmetbagci3447
    @mehmetbagci34477 ай бұрын

    Amazing tutorial. Thank you for sharing

  • @SakuraDev

    @SakuraDev

    7 ай бұрын

    Thanks 🙏

  • @0xIslamTaha
    @0xIslamTaha Жыл бұрын

    Thanks for sharing, one of the best crash course regarding NestJs

  • @SakuraDev

    @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 🌷🌷

  • @rayenselmen603
    @rayenselmen6038 ай бұрын

    Good !

  • @SakuraDev

    @SakuraDev

    8 ай бұрын

    Thanks 🙏

  • @Nanashi-rq7lk
    @Nanashi-rq7lk11 ай бұрын

    Perfect Video

  • @SakuraDev

    @SakuraDev

    11 ай бұрын

    Glad you think so!

  • @quamzgraphix9826
    @quamzgraphix9826 Жыл бұрын

    very good video. keep up the good works.

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    Thank you for sharing your positive comment 🌷🌷

  • @user-hq1yd8iw1c
    @user-hq1yd8iw1c9 ай бұрын

    Good job! Will your next video for nests +prisms tutorial

  • @user-zd7tg3kh4k
    @user-zd7tg3kh4k11 ай бұрын

    thanks so much 谢谢 :

  • @SakuraDev

    @SakuraDev

    11 ай бұрын

    Your welcome 🙏🌹

  • @MightyKingKala
    @MightyKingKala11 ай бұрын

    that's was nice video thanks

  • @SakuraDev

    @SakuraDev

    11 ай бұрын

    Glad you liked it!

  • @viswanaths7603
    @viswanaths7603 Жыл бұрын

    Good video and explanation

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    Thanks 🌷

  • @andrejkling3886
    @andrejkling38863 ай бұрын

    Amazing tutorial… thanks a lot 🔥🔥🔥💯 can you create some real project with this tools please?

  • @sushilgyawali7880
    @sushilgyawali788010 ай бұрын

    thanks

  • @SakuraDev

    @SakuraDev

    10 ай бұрын

    You're welcome! 🌷

  • @tanhoangtrong2480
    @tanhoangtrong2480 Жыл бұрын

    Thank you so much. Can u make more video about Nest?

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    Nice 👍 .

  • @fvagvTV
    @fvagvTV Жыл бұрын

    Great tutorial! I would like your opinion on using Prisma over Typeorm ? Looking forward for future videos like this!

  • @SakuraDev

    @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.

  • @ezramollena7588
    @ezramollena75887 ай бұрын

    what a cool tutorial, i wonder if you have a tutorial setting up cicd for your nest app to aws ?

  • @SakuraDev

    @SakuraDev

    7 ай бұрын

    Thanks 🙏. I need to do some research about it

  • @quamzgraphix9826
    @quamzgraphix9826 Жыл бұрын

    I would really appreciate it if you can do a video about how to dockerize react/next apps

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    Hi, I will do that soon.

  • @lmessi5924
    @lmessi5924 Жыл бұрын

    🔊 Since OP is using Docker for DB connection, please stop your locally installed postgres, otherwise you would get testDB database does not exist.

  • @SakuraDev

    @SakuraDev

    Жыл бұрын

    yes, thanks for your tip. if you want to use local postgres, just create testDB, manually.

  • @gamedevbrownbus2871

    @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.

  • @prashlovessamosa
    @prashlovessamosa11 ай бұрын

    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

    @SakuraDev

    11 ай бұрын

    Yeah I will put it on my list.

  • @yasserhy
    @yasserhy Жыл бұрын

    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

  • @nemonobody1535
    @nemonobody153511 ай бұрын

    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

    @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

    @imamsutono4530

    11 ай бұрын

    I have the same issue. So I try @lmessi5924 suggestion to stop the local postgres service, and it works. Hope this help.

  • @_codesan
    @_codesan11 ай бұрын

    it is good to use nestjs as a backend and nextjs as frontend?

  • @SakuraDev

    @SakuraDev

    11 ай бұрын

    Yeah it's really awesome

  • @SakuraDev

    @SakuraDev

    11 ай бұрын

    It is my stack.

  • @_codesan

    @_codesan

    11 ай бұрын

    @@SakuraDev will you create a video about that in the future? maybe with drizzle too

  • @SakuraDev

    @SakuraDev

    11 ай бұрын

    @@_codesan Yes I put it on my list. It is a good idea.

  • @pacificview8276
    @pacificview827610 ай бұрын

    1 project on nest js plz

  • @SakuraDev

    @SakuraDev

    10 ай бұрын

    hi, I have created a new one: kzread.info/dash/bejne/nZyC2dR_epC-odY.html

  • @pacificview8276

    @pacificview8276

    10 ай бұрын

    @@SakuraDev oh my god I was looking for this you made it.. Millions of thanks ❤ dear for your effort for us

  • @SakuraDev

    @SakuraDev

    10 ай бұрын

    @@pacificview8276 😃😃🙏🙏🙏🙏

  • @Vivek-Nishad
    @Vivek-Nishad Жыл бұрын

    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.