Build Nest.js Microservices With RabbitMQ, MongoDB & Docker | Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 203

  • @jafar1607
    @jafar1607 2 ปีที่แล้ว +18

    Wow. This dude is just giving away thousands of dollars worth education for free.
    Salute to you sir. You are helping many.
    I wish all the success in your career.

  • @renends7615
    @renends7615 2 ปีที่แล้ว +28

    This content is unique, it helps us understand, something very complicated into something simple.
    Great tutorial!

  • @chinmayanand896
    @chinmayanand896 ปีที่แล้ว +2

    I am watching you videos and this video specifically it is really great to have such content. Because there is almost no one on the internet who is helping with Microservices with NestJS. Thank you for the content from all of us. I am sure many people will take help from this video.

  • @andyslack1167
    @andyslack1167 ปีที่แล้ว +2

    Really helped me get up and running quickly with NestJS Microservices and RabbitMQ, thank you! Grab beer or two on me!

    • @mguay
      @mguay  ปีที่แล้ว

      Thank you so much!

  • @ezequielgnich
    @ezequielgnich 4 หลายเดือนก่อน

    Hello Michael, I would like to thank you very much for this content, it is very rich in detail and helped me a lot to understand a little more about microservices and also monorepo with NestJS. You've gained another subscriber. Congratulations on a job well done.

  • @ArturDani
    @ArturDani 2 ปีที่แล้ว +6

    Wow, this was the missing piece for me to start using microservices pattern. The puzzle is almost completed (just waiting for deployment part) :)
    Thank you, Sir.

  • @MrOrrGoren
    @MrOrrGoren 2 ปีที่แล้ว +5

    Thank you so much for the great tutorial!
    Just a heads up for anyone using Macbook M1 with the ARM64 chip, Bitnami doesn't support it yet.

  • @defrankline
    @defrankline 2 ปีที่แล้ว +1

    This tutorial makes microservice implementation looks so simple. Thanks coder!

  • @lexNwimue
    @lexNwimue หลายเดือนก่อน

    This is awesome, man. Has been very helpful to me

  • @pramodkharade5373
    @pramodkharade5373 2 ปีที่แล้ว +1

    It was an excellent explanation. Ton of things, we can learn. Just waiting for deployment part

  • @cumuluscycles
    @cumuluscycles หลายเดือนก่อน

    Excellent tutorial! This works out-of-the-box from your Repo on a Mac with an Intel Processor, as expected, but I've been trying to update the Images for the Apple M1 ARM64 Arch. Have you tried this as well and, if so, would you mind sharing updated docker-compose / Dockerfile(s)?

  • @Vahidk2222
    @Vahidk2222 4 หลายเดือนก่อน

    Thanks man, it's really comprehensive. I learnt a lot from it

  • @codesuit
    @codesuit 2 ปีที่แล้ว +2

    Awesome! Thanks for the great content, waiting for the deployment part!! ♥ Thx Bro.

  • @codinghubfree
    @codinghubfree 6 หลายเดือนก่อน

    The way you explained is really awesome and helpfull. I have some confusions : Why do we need to create two JwtAuthGuard and how you are deciding where to use JwtAuthGuard and flow of its execution?

  • @g-luu
    @g-luu 2 ปีที่แล้ว +1

    Best nestjs channel out there.

  • @LelekCZE
    @LelekCZE 2 ปีที่แล้ว +2

    Hey Michael, thanks for the tutorial, super educative! Do you plan to do a tutorial for authorization in NestJS?

    • @mguay
      @mguay  2 ปีที่แล้ว

      Thanks! I have a video on this, check out my channel.

  • @a.nk.r7209
    @a.nk.r7209 2 ปีที่แล้ว

    Awesome quality content. No BS.

  • @VeeWebCode
    @VeeWebCode 8 หลายเดือนก่อน +2

    litterlay a gold mine . nothing else to say 😘😘

  • @sarunmrzn
    @sarunmrzn 2 ปีที่แล้ว

    Every one of your video helps me so much, thanks for doing this!

  • @virajbaswana
    @virajbaswana ปีที่แล้ว

    Such an amazing video. Really helped me learn and build my own custom project. Much Thanks. Looking forward for more nestjs content

  • @nsfmatios
    @nsfmatios 2 ปีที่แล้ว +4

    Awesome content! Really well explained and it's insane how every time I watch some NestJS content I learn a new way of doing the same thing. This bad boy is actually quite flexible for a framework. Do you plan on doing a video where you e2e test an application? One of your videos on unit testing really helped me on work 🙏🏽

    • @mguay
      @mguay  2 ปีที่แล้ว +5

      Thank you! I have a video on E2E testing here: th-cam.com/video/R2ndY_JhxWk/w-d-xo.html

  • @zackinfos5933
    @zackinfos5933 8 หลายเดือนก่อน

    Thank you sir for everything you're doing for us, but could you please tell me why you have followed the one shared db approach for all microservices you have implemented? The one db per each microservice could be more suitable for microservices architecture.

  • @PrashilLonakar
    @PrashilLonakar 2 หลายเดือนก่อน

    Really Appreciated , thanks for this great tuts. helps a lot.

  • @oigiangbekelvin133
    @oigiangbekelvin133 2 ปีที่แล้ว +1

    You're the best. waiting for the deployment part

  • @brynjarsmaribragason780
    @brynjarsmaribragason780 2 ปีที่แล้ว

    Awesome! Looking foward to the deployment video!

  • @АлександрЕлагин-м2ю
    @АлександрЕлагин-м2ю 2 ปีที่แล้ว +1

    Very cool 👍 graphql federation with microservices maybe in future ?

  • @zlatkoiliev8927
    @zlatkoiliev8927 11 หลายเดือนก่อน +2

    I got issues with MongooseModule, it says it can’t connect to mongodb-primary 😢

  • @lukaspabijonavicius6890
    @lukaspabijonavicius6890 ปีที่แล้ว

    You are very good at teaching. Keep it up.

  • @Dhirajkumar-ux5ug
    @Dhirajkumar-ux5ug ปีที่แล้ว +4

    Nice video and great content , Can you make a enterprise level application using NestJS with micro-service architecture in which you cover e2e testing , caching, queue management system etc. which required to make production level application using micro-services architecture.

  • @lik1142
    @lik1142 ปีที่แล้ว

    Thanks so much for the tutorial and the source code, it is much help to understand the concept

    • @mguay
      @mguay  ปีที่แล้ว

      Thank you for your support!

  • @murat.terzioglu
    @murat.terzioglu ปีที่แล้ว +1

    Wonderful video mate! Helped a lot to understand the system and I would like to give a feedback. Can you make commits as you make progress? For example we have "docker", "microservices" and "billing app" chapters on youtube, wouldn't be good if you make commits for each youtube chapter?

  • @postfell
    @postfell 2 ปีที่แล้ว

    Minute 5:46, I am loving this tutorial, thanks!

  • @totemsports1267
    @totemsports1267 2 ปีที่แล้ว +1

    Hi Michael, this is really nice, keep it up and thank you.
    I was wondering instead of building authentication service from scratch is it possible to integrate keycloak in your setup as well as api gateways like apisix? If you can create a video that incorporates the two, that would be great. Otherwise thank you for such wonderful and educative videos.

  • @mohammadrendra2062
    @mohammadrendra2062 ปีที่แล้ว +3

    For those who's having these problems:
    1. Python not found when running docker-compose (and you tried npm config set yet failed, nogde-gyp configure yet failed):
    Try replacing bcrypt with bcryptjs
    2. Error when connecting to database (if you're using Apple Silicon):
    Try changing the mongo image to: mongo:4.4.14. And if that doesn't work, try add these envs:
    - to your secondary and arbiter services on your docker-compose.yml: MONGODB_INITIAL_PRIMARY_ROOT_USERNAME=root
    - to your mongodb-primary:
    MONGO_INITDB_ROOT_USERNAME=root
    replace the MONGODB_ROOT_PASSWORD=password123 with MONGO_INITDB_ROOT_PASSWORD=password123
    Hope this helps

  • @sigitkuncoro43
    @sigitkuncoro43 2 ปีที่แล้ว

    really good tutorial, thank you for creating this video
    bay the way, sometimes when creating an app we also need the second auth for admin, regarding with auth guard, what is the best practice you advise for this case?

  • @DakshanshGorasia
    @DakshanshGorasia 10 หลายเดือนก่อน

    Thanks for the awesome video Michael. I was wondering how it is possible to connect to 2 databases from one of the microservice and second microservice connects to only second database and both are responsible for read/write operations in that database. I know there can be microservice communication used but if we wan to avoid the delay.

  • @ms0615122
    @ms0615122 2 ปีที่แล้ว

    Thank you very much! Viewer from Taiwan.

  • @sealuke2724
    @sealuke2724 2 ปีที่แล้ว

    your tutorial is pretty awesome, very well structured

  • @anuragannu8930
    @anuragannu8930 ปีที่แล้ว

    damn, I learn so many things in one video, thanks, bro.

  • @hugotown.entertainment
    @hugotown.entertainment ปีที่แล้ว

    This content is amazing, Thank you very much, is the best content ever!

  • @franccescomichaeljaimesagr7162
    @franccescomichaeljaimesagr7162 ปีที่แล้ว +1

    That was a really good content! One question, if my monorepos had different dependencies, do I necessarily have to create a package.json file in each microservice and have the node_modules folder in each microservice? Could I have common dependencies and also specific dependencies at the same time?
    Sorry for the questions. I hope you can understand my questions.
    My native language is spanish 😅. Greetings from Peru.

    • @mguay
      @mguay  ปีที่แล้ว +3

      This is a great question. You could make the individual approach with each service having its own package.json/node_modules, or you have a shared one like in my video.
      I am not sure if it is possible to have shared/individual at the same time but I would be curious to learn!

    • @milon27
      @milon27 ปีที่แล้ว

      @@mguay can you share any resources link how to setup individual package.json in each micro service?

  • @TheThornTech
    @TheThornTech 2 ปีที่แล้ว

    The course that i waiting for, Thank you so much sir!

  • @nitishagrahari9943
    @nitishagrahari9943 ปีที่แล้ว

    excellent tutorial ... great content in such a short time

  • @jheremiaspulache6836
    @jheremiaspulache6836 2 ปีที่แล้ว

    Great tutorial, thanks. Why using MessagePattern and switch to rpc? In Auth microservice the rmq auth queue is connected, isn't that mean that we can use EventPattern in auth controller?

  • @kimmdev
    @kimmdev 2 ปีที่แล้ว +2

    Thanks! Tutorial straight to the point.
    In my case I came across the problem, have you dealt with this error? "There is no matching message handler defined in the remote service."

  • @mulahem
    @mulahem 10 หลายเดือนก่อน

    hey, you have dropped this ... 👑

  • @marc-andrequintal570
    @marc-andrequintal570 ปีที่แล้ว

    Really nice, were you able to connect into mongo atlas? I can't and it would be great to see data into database

  • @shahzaibahmed4090
    @shahzaibahmed4090 ปีที่แล้ว

    Very helpful tutorial. Thank you so much.

  • @codeguy7309
    @codeguy7309 2 ปีที่แล้ว

    absolute gold, thank you man

  • @sportly-vlog
    @sportly-vlog 2 ปีที่แล้ว

    @Michael, thank you for the great tutorial. I have a quick question regarding deployment. You see... the Billing service doesn't listen to any port. With this setup, how do I go about health-checking the service container within AWS ECS? The easiest option that I came to my mind is making it hybrid app just like the Auth service to be able to make a HTTP call to the container via the port. What else option do I have?

  • @mohammedlotfy
    @mohammedlotfy ปีที่แล้ว

    Nice video Michael but I suggest to use any diagram for more simplification before starting that will make it very easy and will get new ideas from comments sure

  • @kirakira160
    @kirakira160 2 ปีที่แล้ว

    OMG!! Our Best Teacher Are Back🥰

    • @mguay
      @mguay  2 ปีที่แล้ว

      Appreciate the support!

  • @evil-cheetah
    @evil-cheetah 2 ปีที่แล้ว

    You are amazing! Thank you very much for such great content!

  • @kusaasira
    @kusaasira ปีที่แล้ว

    Great content. Michael Guay, on the auth service, why is it that instead of validation I do get always a 401 Unauthorized? Is there a way of working around this?

  • @bhupenpal
    @bhupenpal ปีที่แล้ว

    Hi! Thanks for the great tutorial... Is it possible to specify queue while emitting the event?

  • @brucearmstrong5536
    @brucearmstrong5536 ปีที่แล้ว

    Awesome Stuff,
    I realized that sevices connect to same db,
    and u have userModule a sub module for parent Auth
    As Auth is dependent on user
    and Splitting it into 2 micro services get this tutorial complex
    Question:
    is it Good to connect API with mongoDB directly through mongoose for same user collection "mongoose.forfeature({ schema: user, name : user })"
    instead of, exporting userservice , repository or userSchema and importing the user module in auth module ?
    Is this a good practice ?
    adding "mongoose.forfeature({ schema: user, name : user })" for 2 different modules that dependent on same collection
    I can see some benifits like easier to switch between monolithic / microservices
    more cleaner and not to much nested file structure
    Not expert at nest or mongodb

  • @patrykkowalski1305
    @patrykkowalski1305 2 ปีที่แล้ว +2

    Hello, two questions:
    Why billing service doesn't have a port defined?
    Shouldn't we have a separate database for each service?

    • @menottitrades
      @menottitrades 2 ปีที่แล้ว

      I wonder the same

    • @theaungmyatmoe
      @theaungmyatmoe ปีที่แล้ว

      you don't need to define port in billing app because the app is not listen on the http or tcp. It''s listening to the Rmq

  • @alexispell4251
    @alexispell4251 2 ปีที่แล้ว

    Hello! First of all- thanks for such a gift without christmas!
    Highly liked this course and want to discuss interesting moment, concerning docker-compose.
    For example, we got a string - /usr/src/app/node_modules in our orders container.
    But it makes us involved in a problem - each time when we install new deps - we have to restart with docker-compose up --build -V.
    Which is unnecessary, if we get rid of this string.
    Do i understand it right, that there are some things, that i dont understand and this is not a mistake?
    Thanks in advice :3

    • @alexispell4251
      @alexispell4251 2 ปีที่แล้ว

      and envFilePath: './apps/orders/.env',
      also is redundant here and may be omitted

  • @tonskreee6213
    @tonskreee6213 2 ปีที่แล้ว +2

    Hi Michael,
    May I know why both on Auth and Billing service you define the app.connectMicroservice functionality but in Order service you didn't define the connectMicroservice instead you call the RmqModule.register which calls the ClientsModule.register, is there a rule for this one? because I thought when we want to define our service as microservice we need to call the connectMicroservice for each services? sorry im new to microservice and nestJS.

    • @oyinlolaolasunkanmi
      @oyinlolaolasunkanmi 2 ปีที่แล้ว +1

      the order service serves as the entry point into the application. Therefore you need to instantiate Rabbit MQ from there.

  • @cosmic12333
    @cosmic12333 5 หลายเดือนก่อน

    thanks so much for this video, i love it

  • @christian11x3
    @christian11x3 2 ปีที่แล้ว

    +1000 loved your content and looking forward for your next video. Thank you and best of luck

  • @devorer77
    @devorer77 ปีที่แล้ว

    Thank you! Really useful tutorial.

  • @leducanh2225
    @leducanh2225 ปีที่แล้ว

    Thank you for sharing awesome source code.

  • @JollyReaper_666
    @JollyReaper_666 ปีที่แล้ว

    well explained, learned a lot, liked the way you make use of the common library for rmq and mongo
    I'm having a bit of trouble connecting to my mongodb when using compass, can I simply connect on localhost:27017 with root:password123 ? or is it different with the way it's set up in your video?

  • @dev_jeongdaeri
    @dev_jeongdaeri 2 ปีที่แล้ว

    You are the best!! 😍

  • @its_grs
    @its_grs 2 ปีที่แล้ว

    Great content. Thank you. I have a small doubt regarding registering the RmqModule. You have registered it in order module import. However If I want to use it in another module should I register again? Or is there anyway I can register it to a common module and import that module everywhere else in my code. For example emailQueue is something that I might require in multiple modules (order, billing and auth). Can you suggest me a generic way to register EMAIL_SERVICE (emailQueue) in all the modules please?

  • @LamLe-cl4he
    @LamLe-cl4he 2 ปีที่แล้ว

    Many thanks, great tutorial!

  • @pt4shk4
    @pt4shk4 8 หลายเดือนก่อน

    I'm wondering if there or anywhere else a tutorial for doing database stuff like in this video but with typeorm and rdb?

  • @MrJony-fv3ev
    @MrJony-fv3ev ปีที่แล้ว

    May I ask a question
    Monorepos can't be deployed seperately, so why is this still considered as microservices?
    It's more monolithic app structure I guess
    Thanks!

  • @KePaco-mf1bf
    @KePaco-mf1bf 9 หลายเดือนก่อน

    Hi Michael, I'm a newbie with NestJS and RabbitMQ, this series is really nice and helps me a lot to understand, thank you!
    But I got the error when I practiced, I followed the steps that you did and also downloaded your case to references, but I got these errors while I emitted the message. Do you know what's happened?
    Error:
    WARN [Server] An unsupported event was received. It has been acknowledged, so it will not be re-delivered. Pattern: notifications

  • @chhaytoch1376
    @chhaytoch1376 2 ปีที่แล้ว

    It's very great tutorial for microservice senior. Anyway, could you guide or explain us how do we manage the API Versioning for both Route & Codebase?

    • @mguay
      @mguay  2 ปีที่แล้ว

      Good idea.

  • @valerymbele4451
    @valerymbele4451 2 ปีที่แล้ว

    Hi Michael. Thanks a lot for such a great tuto. i was struggling with architecture and evething looks more clear now . I previously follow your tuto about gcloud kubernettes deploiement , but that was for mono repo . Please could you show how to deploy this architecture ? how the dockerfile and deploiement.yml should look like , and witch image(s) is sent to docker hub. Thanks in advance.

    • @valerymbele4451
      @valerymbele4451 2 ปีที่แล้ว

      i finally found your tuto deploying on AWS

  • @misbauddinchowdhury2180
    @misbauddinchowdhury2180 11 หลายเดือนก่อน

    Why I can't connect mongodb replicaset in my Macbook M1. Error throwing like this
    [Nest] 69 - 10/24/2023, 10:35:24 AM ERROR [MongooseModule] Unable to connect to the database. Retrying (1)...

  • @nestieyt
    @nestieyt ปีที่แล้ว +1

    Hot reload not working on docker-compose with the NestJS 10. I couldn't fix it. Can you help me?

  • @ElyesBoudhina
    @ElyesBoudhina 7 หลายเดือนก่อน

    Did you create an APi gateway?

  • @programmingdoze7025
    @programmingdoze7025 2 ปีที่แล้ว

    @michael thanks. Can u throw some light on nestjs with saga topic? I am really confused with saga

  • @AntonGorbachevDev
    @AntonGorbachevDev 2 ปีที่แล้ว

    Thx for great content, i learn alot from this video!)

  • @none4614
    @none4614 ปีที่แล้ว

    Fantastic video !!
    Could you make a fullstack microservice project that apply rabitMQ, Kafka, docker, k8s, ...
    Thanks so much.

    • @mguay
      @mguay  ปีที่แล้ว +1

      My new Ultimate Nest.js Microservices course will cover this! Stay tuned for its release in May.

  • @yaiDev
    @yaiDev ปีที่แล้ว

    Thank you for great tutorial. But I'm not idea write unit testing for controller and services. I try to write a. unit test but not work because it many dependencies. Please help or guide how write unit test.

  • @tzion21
    @tzion21 ปีที่แล้ว

    ​ @Michael Guay hey, do you have any course about nestjs with microservices from scratch?
    or another option, what is the best approach to learn nest js and microservices? i know express, and i know the concept of microservices, but i did not understand what is nestjs and nestjs microservices . thanks

  • @girish_rajpoot
    @girish_rajpoot 5 หลายเดือนก่อน

    I got issues with MongooseModule, it says it can’t connect to mongodb-primary. Please resolve. @Michael

  • @mguay
    @mguay  ปีที่แล้ว +2

    Get my highly rated NestJS Microservices Course at a discount: michaelguay.dev/udemy

    • @daidang8252
      @daidang8252 8 วันที่ผ่านมา

      Thank you! I bought your course!

  • @LelekCZE
    @LelekCZE 2 ปีที่แล้ว

    How would I go about enabling HMR for the individual microservices? I am able to do it for regular NestJS app setup, but with this shared libraries approach, I am not able to figure it out unfortunately.

  • @mattiastornqvist5311
    @mattiastornqvist5311 ปีที่แล้ว

    Very good stuff indeed! Anyone got an idea of how the MongoDB connection string will look like if I try to connect to the running db instances using Compass?

  • @patrickjoseph5205
    @patrickjoseph5205 ปีที่แล้ว

    Hi Michael. I followed through the video however I want to deploy this on a service like Render. Could you help with this?

  • @DheerSinghDel
    @DheerSinghDel ปีที่แล้ว

    How do we ensure the transaction atomicity in case of any failure, such that the messages are not standing as orphan data in rabbitmq for processing?

  • @YorkshireScooter
    @YorkshireScooter 2 ปีที่แล้ว

    This video is awesome, may i ask which vscode theme this is?

    • @mguay
      @mguay  2 ปีที่แล้ว

      Thanks! Material Theme

  • @kennethirungu6482
    @kennethirungu6482 2 ปีที่แล้ว

    Awesome work !!,
    Keep it up !!

  • @aletothemoon
    @aletothemoon ปีที่แล้ว

    Hey nice content! Can you share your vscode extensions and theme?

  • @rufatgulabli698
    @rufatgulabli698 ปีที่แล้ว +1

    Great tutorial. Thanks, Michael. For those who have a problem related to MongoDB connection, try below string;
    MONGO_URI=mongodb://root:password123@localhost:27017/?authMechanism=DEFAULT&directConnection=true

  • @rahff99
    @rahff99 2 ปีที่แล้ว

    Hi, at 1:11:05 in ordering apps auth section, I don't understood why are you inject(AUTH_SERVICE) constante which is a string value as injector for clientProxy. How works this and in what way does this constant refer to this service ?

  • @MK-we4dl
    @MK-we4dl ปีที่แล้ว

    Hi. How to set username and passworf for RabbitMQ in connection options?

  • @adriandrozman3404
    @adriandrozman3404 2 ปีที่แล้ว

    You are the best,thanks!!!

  • @Imen_lakrib
    @Imen_lakrib 9 หลายเดือนก่อน

    What about polyrepo .. is it a same way?

  • @oyinlolaolasunkanmi
    @oyinlolaolasunkanmi 2 ปีที่แล้ว

    How does my application consume multiple queues. I saw an approach someone suggested on stackoverflow where you repeat the "app.connectMicroservice" for each queues, is there a cleaner approach ?

  • @ekopurnomo9221
    @ekopurnomo9221 ปีที่แล้ว

    thank youuu.... for the tutorial😁

  • @MK-we4dl
    @MK-we4dl ปีที่แล้ว

    How in this configuration work whis different queue in one client?

  • @burakbey1775
    @burakbey1775 2 ปีที่แล้ว

    Great content 🙏🏻

  • @milon27
    @milon27 ปีที่แล้ว

    @Michael Guay can you share any resources link how to setup individual package.json in each micro service?

    • @mguay
      @mguay  ปีที่แล้ว +1

      My new Ultimate Nest.js Microservices course will cover this! Stay tuned for its release in May.

  • @olaboyeolanrewaju134
    @olaboyeolanrewaju134 ปีที่แล้ว

    I cannot find the bitnami mongodb image repo seems it is no longer open sourced?