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

КОМЕНТАРІ • 69

  • @azizbek1106
    @azizbek1106 Рік тому +25

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

    • @SakuraDev
      @SakuraDev  Рік тому +1

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

    • @minhtetoo80
      @minhtetoo80 Рік тому +7

      It's NestJS. Not NextJS

    • @azizbek1106
      @azizbek1106 Рік тому +3

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

    • @NobleOsinachi
      @NobleOsinachi Рік тому +1

      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

  • @viralmoney8619
    @viralmoney8619 9 місяців тому +3

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

  • @furkanc6407
    @furkanc6407 Рік тому +1

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

    • @SakuraDev
      @SakuraDev  Рік тому

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

  • @evanskwofie2443
    @evanskwofie2443 Рік тому +3

    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 : ua-cam.com/video/twaUdKr06kA/v-deo.html

  • @logistics_guy
    @logistics_guy Рік тому +2

    This channel is sick. Thank man!

    • @SakuraDev
      @SakuraDev  Рік тому

      Hi, Is that a complement? 😂

  • @kritsana6170
    @kritsana6170 Рік тому +1

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

  • @ogbuezekiel7400
    @ogbuezekiel7400 8 місяців тому

    Nice work man. You're the best!!

    • @SakuraDev
      @SakuraDev  8 місяців тому

      Thanks you so much 🙏💖

  • @rayhankabir6419
    @rayhankabir6419 5 місяців тому +1

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

  • @mehmetbagci3447
    @mehmetbagci3447 7 місяців тому +1

    Amazing tutorial. Thank you for sharing

  • @0xIslamTaha
    @0xIslamTaha Рік тому +1

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

    • @SakuraDev
      @SakuraDev  Рік тому +1

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

  • @quamzgraphix9826
    @quamzgraphix9826 Рік тому +2

    very good video. keep up the good works.

    • @SakuraDev
      @SakuraDev  Рік тому +2

      Thank you for sharing your positive comment 🌷🌷

  • @nimanikoonazar1541
    @nimanikoonazar1541 3 місяці тому

    great video

  • @Nanashi-rq7lk
    @Nanashi-rq7lk 11 місяців тому

    Perfect Video

    • @SakuraDev
      @SakuraDev  11 місяців тому

      Glad you think so!

  • @rayenselmen603
    @rayenselmen603 8 місяців тому

    Good !

  • @viswanaths7603
    @viswanaths7603 Рік тому +1

    Good video and explanation

  • @user-hq1yd8iw1c
    @user-hq1yd8iw1c 9 місяців тому

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

  • @SiavashSol
    @SiavashSol Місяць тому

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

  • @user-zd7tg3kh4k
    @user-zd7tg3kh4k 10 місяців тому +1

    thanks so much 谢谢 :

    • @SakuraDev
      @SakuraDev  10 місяців тому

      Your welcome 🙏🌹

  • @fvagvTV
    @fvagvTV Рік тому +1

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

    • @SakuraDev
      @SakuraDev  Рік тому +1

      Hi, Thanks 🙏🙏. Well, I think, since Prisma uses objects instead of class instances for returning data, It might be faster in data intensive apps.

  • @tanhoangtrong2480
    @tanhoangtrong2480 Рік тому +1

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

  • @MightyKingKala
    @MightyKingKala 10 місяців тому

    that's was nice video thanks

    • @SakuraDev
      @SakuraDev  10 місяців тому

      Glad you liked it!

  • @andrejkling3886
    @andrejkling3886 3 місяці тому +1

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

  • @sushilgyawali7880
    @sushilgyawali7880 10 місяців тому

    thanks

    • @SakuraDev
      @SakuraDev  10 місяців тому

      You're welcome! 🌷

  • @ezramollena7588
    @ezramollena7588 7 місяців тому

    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

  • @lmessi5924
    @lmessi5924 Рік тому +2

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

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

  • @prashlovessamosa
    @prashlovessamosa 11 місяців тому +1

    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.

  • @nemonobody1535
    @nemonobody1535 11 місяців тому +1

    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
    @_codesan 11 місяців тому

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

    • @SakuraDev
      @SakuraDev  11 місяців тому

      Yeah it's really awesome

    • @SakuraDev
      @SakuraDev  11 місяців тому +1

      It is my stack.

    • @_codesan
      @_codesan 11 місяців тому +1

      @@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
    @pacificview8276 10 місяців тому

    1 project on nest js plz

    • @SakuraDev
      @SakuraDev  10 місяців тому

      hi, I have created a new one: ua-cam.com/video/khNwrFJ-Xqs/v-deo.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.