Build Complete REST API in NestJs #1 - with TypeScript & MongoDB

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • Final Code:
    github.com/ghu...
    Complete In-Depth NestJs UDEMY Courses:
    www.udemy.com/...
    ⚙️ Gadgets I use for Recording:
    💻 Laptop - Macbook PRO M1 - 16/512
    amzn.to/4eUqrSe
    🎤 MIC - Samson Technologies Q2U USB/XLR Dynamic Microphone
    amzn.to/3W9Z4wl
    🖱️Mouse - Logitech G402 Gaming Mouse Hyperion Fury USB, Black
    amzn.to/3RY4xUy
    ⌨️ Keyboard - Logitech K380 Multi-Device Bluetooth Keyboard
    amzn.to/3RY4Fn0
    🖥️ Monitor - UltraSharp 24-Inch Screen Led-Lit Monitor (U2419H)
    amzn.to/4bxidN6
    In this video, we will learn how we can make a complete rest API in NestJS using typescript and MongoDB. We will take a look at the NestJs folder structure and learn about what are modules controllers and services in NestJS.
    We will also learn about schemas and also what are data transfer objects or dto's. We will create a library API in which we will create book module and perform all CRUD operations in that.
    Like subscribe and share for more videos.

Комментарии • 62

  • @ATV-sy2ri
    @ATV-sy2ri 11 дней назад +1

    Abbas you are an excellent teacher.
    This video could've been longer though, for a beginner.

    • @codingwithabbas
      @codingwithabbas  11 дней назад

      You can watch next part of this series. It's a complete playlist.

  • @AhmedHusseinMohamedAly
    @AhmedHusseinMohamedAly 9 месяцев назад +1

    Great tutorial and you are a super intelligent developer.

  • @abdulwaris5496
    @abdulwaris5496 Год назад +2

    Amazing content and your English is helpful for non-natives!!

  • @mr_ahmad_70
    @mr_ahmad_70 5 месяцев назад

    Thank You So Much Sir I was very scared of OOPS bcz my background was of express js and functional only not the classes, thanks to your explanation, now I can do a crud. It would be great if you make a video on Authentication as well

    • @codingwithabbas
      @codingwithabbas  4 месяца назад

      Already made vide on that:
      ruclips.net/video/ED8uWgE-KeY/видео.html

  • @rehan5383
    @rehan5383 11 месяцев назад

    You are my hero. beautifully explained.

  • @scottm.86
    @scottm.86 11 месяцев назад

    Great video, very clear instructions and explanation. Thank you!

  • @ChinelsyAgudike
    @ChinelsyAgudike Год назад

    Lovely, love your data structure, looking forward to more. I have finally found what i will use in learning Nest js with mongodb, best tutorial so far. keep it up

  • @pabloc1519
    @pabloc1519 11 месяцев назад

    Thank you for the very straightforward information!!!!!

  • @faustozambrano4901
    @faustozambrano4901 3 месяца назад

    Thanks for the tutorial, buddy

  • @kingb772
    @kingb772 8 месяцев назад

    Really helped, Thank You!

  • @awaraamin6850
    @awaraamin6850 9 месяцев назад

    It is an informative video, thank you.

  • @kukuster
    @kukuster 6 месяцев назад +2

    NOTE: at minute 9 you will not actually have a successful connection to a database (called "library-next-api" in this case) like on the video, unless you already created it beforehand. But! The database will be created automatically later when you insert a first record

    • @aryanddaga
      @aryanddaga 3 месяца назад

      how do I do that?

    • @kukuster
      @kukuster 3 месяца назад

      ​@@aryanddaga you can start mongoDB CLI by executing `mongo` in the terminal, then write `use ` inside. This will create an empty db. But the point of what I wrote is that you can ignore that error, because in the following steps you'll execute something that inserts the first record successfully and it'll automatically create the database for you

  • @revxl722
    @revxl722 5 месяцев назад

    Great video

  • @Wardret
    @Wardret Год назад

    very good content, GJ

  • @brortiz
    @brortiz 29 дней назад

    Hey Abbas, thanks a lot for the tutorial. I just got one little issue, on the PUT request I don't get any response in Postman, the other ones work great (findAll, findById, createBook, etc). I made sure I got the correct ID and also even tested with your own cloned version. Anyone else with the same problem?

    • @codingwithabbas
      @codingwithabbas  28 дней назад

      You are getting blank response. Is document in DB updated?

  • @jayb2128
    @jayb2128 2 месяца назад

    Really like this, but when listening through headphones that subscribe sound that happens every so often is very frustrating.

    • @codingwithabbas
      @codingwithabbas  2 месяца назад +1

      Thanks for your feedback. I am not adding that in new videos.

  • @Khalil.WebDev
    @Khalil.WebDev Год назад

    Hello Abbas,
    I like the way you teach, explain and code in practice. I tried to Enroll to your NestJS course on Udemy but it seems that your course is not included in the Udemy Business content collections.

    • @codingwithabbas
      @codingwithabbas  Год назад

      Udemy Business collections is managed by Udemy, this course in not yet present in Udemy for Business, I have 2 other Node.js courses in this collection.

  • @jhk1869
    @jhk1869 Год назад

    you are master!

  • @mohammadrehan-zg2bg
    @mohammadrehan-zg2bg Месяц назад

    Can I continue using this format for a large project?

  • @lucasdamasceno7068
    @lucasdamasceno7068 Год назад

    Thanks bro. 🎉

  • @phantazzor
    @phantazzor 3 месяца назад

    what is dto ? why you need it ?

  • @OmarAlJaberProfile
    @OmarAlJaberProfile 9 месяцев назад

    how we can configure multi tenant dynamicly for different db

  • @mustafacavuslu3856
    @mustafacavuslu3856 11 месяцев назад

    Can we call this program library automation?

  • @yadavkishan3778
    @yadavkishan3778 Год назад +1

    please create rest api nest js ecommer api and react js

  • @Engineeeer_1
    @Engineeeer_1 5 месяцев назад

    Great

  • @irfanopc2466
    @irfanopc2466 Год назад

    super

  • @momoh7888
    @momoh7888 Год назад

    thank you

  • @ashishkumari-yg4gn
    @ashishkumari-yg4gn Год назад +2

    Sir,
    After entering incorrect id , I am getting "Internal Server Error" .
    But I should not get anything as per this video at 24:38
    Even after throwing NotFoundException , I still getting the same "Internal Server Error"

    • @codingwithabbas
      @codingwithabbas  Год назад +2

      Have you checked the console, there should be some error.

    • @ashishkumari-yg4gn
      @ashishkumari-yg4gn Год назад

      @@codingwithabbas CastError: Cast to ObjectId failed for value "63fde815b676376155a4a63o" (type string) at path "_id" for model "Novel"
      I'm getting this error sir

    • @spizer98
      @spizer98 Год назад +2

      @@ashishkumari-yg4gn i also get the error so i changed "id" to "_id" it solve the error

    • @ashishkumari-yg4gn
      @ashishkumari-yg4gn Год назад

      @@spizer98 Thank you

    • @sahilgangwani3847
      @sahilgangwani3847 6 месяцев назад

      where exactly did you change the id , on all or in PARAM or where?@@spizer98

  • @josemanuico5613
    @josemanuico5613 Год назад

    sql had a grafic ui for the db. Has mongodb the same funcionality?

    • @MrZnog
      @MrZnog 11 месяцев назад

      I think you're looking for compass?

  • @g-neto6581
    @g-neto6581 Год назад

    It doesn't matter what I try, the mongoose connection doesn't work at all

    • @JamieGomez-cj6hn
      @JamieGomez-cj6hn 11 месяцев назад

      same here, did you manage to solve it?

    • @g-neto6581
      @g-neto6581 11 месяцев назад

      @@JamieGomez-cj6hn unfortunately, I gave up on this project and started a different one to learn rabbitmq with nestjs

  • @arpanadhikary2533
    @arpanadhikary2533 Год назад

    please provide a coupon code for the node js express course

    • @codingwithabbas
      @codingwithabbas  Год назад

      Will provide when available.

    • @lbarria11
      @lbarria11 Год назад

      @@codingwithabbashello how are you any coupon for udemy?

  • @paulj3580
    @paulj3580 7 месяцев назад

    How do you setup your MongoDB bro?

    • @pelumiabdulraheem3705
      @pelumiabdulraheem3705 7 месяцев назад

      have you figured it out?

    • @paulj3580
      @paulj3580 7 месяцев назад

      @@pelumiabdulraheem3705 yes bro

    • @paulj3580
      @paulj3580 7 месяцев назад

      @@pelumiabdulraheem3705 instead of using .env I used to put the connection string in the app.module.ts

  • @franciscooteiza
    @franciscooteiza 8 месяцев назад +1

    Ok? .... Ok! .... Ok

  • @tannedstone3736
    @tannedstone3736 Год назад +1

    28:29

  • @adeelirshad228
    @adeelirshad228 Год назад

    Brilliant video. But please speak a little slow I've to watch this video at 0.5X🤣

  • @faizul_official
    @faizul_official Год назад

    Amazong tutorial

  • @irfanopc2466
    @irfanopc2466 Год назад

    are u indian?

  • @ВиталийБрынза-н9ъ
    @ВиталийБрынза-н9ъ Год назад +1

    Hello. I completely copied the code but for 17.20pm.
    In the postman, I have to get an empty array, and I have an error. I will be glad if you tell you how to solve this problem.
    [Nest] 9008 - 07.07.2023, 13:46:52 ERROR [ExceptionsHandler] command find requires authentication
    MongoServerError: command find requires authentication
    at Connection.onMessage (D:\NestApiBook
    ode_modules\mongodb\src\cmap\connection.ts:413:18)
    at MessageStream. (D:\NestApiBook
    ode_modules\mongodb\src\cmap\connection.ts:243:56)
    at MessageStream.emit (node:events:513:28)
    at processIncomingData (D:\NestApiBook
    ode_modules\mongodb\src\cmap\message_stream.ts:187:12)
    at MessageStream._write (D:\NestApiBook
    ode_modules\mongodb\src\cmap\message_stream.ts:68:5)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at MessageStream.Writable.write (node:internal/streams/writable:337:10)
    at Socket.ondata (node:internal/streams/readable:766:22)
    at Socket.emit (node:events:513:28)

  • @矢沢直輝-f7q
    @矢沢直輝-f7q Год назад +1

    Thank you for the excellent content.
    It might be beneficial to add the following code to the findById, updateById, and deleteById methods in src/book/book.service.ts:
    ```
    if (!mongoose.isValidObjectId(id)) {
    throw new BadRequestException('Invalid ID');
    }
    ```