NestJS gRPC Microservices Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

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

  • @mister-med
    @mister-med ปีที่แล้ว +32

    You truly are the Messi of NestJS.. Thanks for sharing your knowledge with us! 🙏

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

    The way you fix and improve the code is amazing, maybe in my next life I'll learn NestJS... like you.

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

    Thank you, bro! I was looking for some examples of using gRPC with streams, and your explanation was great! 💪

  • @thisisrohan6444
    @thisisrohan6444 10 หลายเดือนก่อน +14

    For Windows user : npx protoc --plugin=protoc-gen-ts_proto=".\
    ode_modules\\.bin\\protoc-gen-ts_proto.cmd" --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/auth.proto

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

    I love the lane of content that you post man. I am a huge fan of using nest js and containerization, so your content has been a huge source of inspiration to learn more into things like this

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

    can't find better than you in Nestjs. thanks for your useful contents ♡♡

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

    nice video, the only video that I learned well about gRPC and nest

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

    OMG, I guess I am in great luck today.. I was about to work on these feature on Monday and this video just popped up on 🔥🔥🔥

  • @Vignesh-v9i
    @Vignesh-v9i 16 วันที่ผ่านมา

    I'm facing issue when I try to run npm run start:dev auth , due to absence of auth.proto inside dist folder, but npm run start:dev is working, yet the dist folder has no .proto file, I even used chatgpt, Claude but I can't fix it .

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

    Thanks a lot. I learning microservises with you from udemy and youtube.

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

    I couldn't follow again after running the protoc command because it errored out:
    protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/auth.proto
    proto/auth.proto:28:1: Expected top-level statement (e.g. "message").

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

    Very nice add to existing content in you full course. 🙏🙏🙏

  • @adR9990
    @adR9990 ปีที่แล้ว +12

    Can you please start providing an architecture diagram of what you are trying to code at the beginning of the video, using Excalidraw or something? It will help viewers visualize what is actually being built.

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

      Sure. Thanks for the suggestion.

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

    how to deploy the gateway services on google cloud or azure, it must listen to the other service and when deploy, the endpoint communicate with the gateway

  • @sekhar-oh6iq
    @sekhar-oh6iq 7 หลายเดือนก่อน

    How to add port number for the auth microservice if we have multiple services are running?

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

    Very helpful! I actually managed to finish the tutorial. Now that I'm back messing around my own personal project, I just have a quick question. Is it possible to await response from a microservice? I basically have a loading UI when a task is ongoing ( saving objects to db) and while I want it to load while awaiting the task to finish and get a response from the microservice (to use that response on the page after the loading UI), I also need the event loop to not get blocked in the process. Does microservices solve this? or would there be a better solution for this. Any reply or a direction would be greatly appreciated. Thanks!

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

      Sounds like an optimistic response from UI (manually altering the current data displayed while waiting the response from backend), Backend shouldn’t care about this

  • @p.eriksonsaragi7129
    @p.eriksonsaragi7129 9 หลายเดือนก่อน

    How to handle exception properly on the apigateway? like find one user which is already deleted, the response is 500 instead of 404. But the auth app correctly throw NotFoundException

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

    how can I catch errors thrown from the auth service on the API Gateway side? I know I should use exception filters, but I've tried several ways and it still doesn't catch the errors.

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

    which version number using protoc cli, latest version not find in auth.ts user service controllers

  • @vsagarprasad6527
    @vsagarprasad6527 8 หลายเดือนก่อน +1

    protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/sample.proto
    this command is giving error: --ts_proto_out: protoc-gen-ts_proto: %1 is not a valid Win32 application.
    can anyone help

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

      if you use windows, just change ./node_modules/.bin to .\
      ode_modules\\.bin

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

    HI, thank you for your great video, but why ts-proto generated socialMedia: SocialMedia | undefined even if there is no optional keyword?

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

    Is there a way to define a gRPC port? I want to test it with other client than the same nestjs

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

    Can we let API gateway communicate with the other microservices by gRPC way as well ?

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

    somebody have the error "terminate called after throwing an instance of 'std::logic_error'
    what(): basic_string::_M_construct null not valid" when use the command protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/auth.proto ?

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

      protoc --plugin=protoc-gen-ts_proto=.
      ode_modules\.bin\protoc-gen-ts_proto.cmd --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/auth.proto

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

      Yes, i am also receiving this error. Can someone help us about that? Is there any compatibility issue with the version of protobuffs? I am using ProtoBuff 24.4

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

    I am confused about the apigateway part in the microservices. Are we supposed to write users module there? Thanks for the video.

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

    Lord of NestJS for sure right there! Good job, excellent video! +1 sub +1 like

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

    best love it

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

    gracias bro, llegaré lejos con tu ayuda!

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

    What about situation u want to use multiple protofiles

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

    Thank you for this amazing video.

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

    This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.

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

    This was something that i wanted to request you for our microservices course, you created a video wow. Will you add a small section in our existing microservice course?

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

      Yes that is next! Thanks for your support.

  • @GuilhermeFaxina-r5q
    @GuilhermeFaxina-r5q 10 หลายเดือนก่อน

    what theme is you using?

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

    Hi, do you have twitter? how do you learn or follow about all the different tools/packages that you use, for example? keda, artillery etc.

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

    Get my NestJS microservices course at a discount here to dive deeper with gRPC & NestJS in a real project: michaelguay.dev/udemy

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

      does this course discuss nest cqrs in more detail that the two videos you made before?

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

    Brilliant video.

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

    Can you please split this into different repos and show how you'd handle the sharing of different proto files between different projects . I think that's where the issue is.

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

      Totally agreed.

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

      That’s the default multiservices problem. Use cloud storage, or private npm

    • @user-93fekod1o
      @user-93fekod1o 6 หลายเดือนก่อน

      well in that case you'd use something else lol. the point of using nestjs and this setup is that you can have everything in one place. If you're going polyrepo, best of luck not losing your mind.

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

      @@user-93fekod1o loool

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

    How do I solve this issue: --ts_proto_out: protoc-gen-ts_proto: %1 is not a valid Win32 application.

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

      Try this
      protoc --plugin=protoc-gen-ts_proto=.
      ode_modules\.bin\protoc-gen-ts_proto.cmd --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/auth.proto

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

      @@nguyenthaituan1836 thans, but I had to create my own custom generator for the typescript code

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

      protoc is not available on windows, you might want to do the development on WSL

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

      But yeah, dunno if there’s an existing alternative that does the same thing as protoc

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

      @@jomelortega7902 better still develop your own

  • @EthanPhan-m2w
    @EthanPhan-m2w ปีที่แล้ว

    Thanks for sharing.

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

    Hey! Love your video, thanks! I came over one question during development, hope you will answer on it: by following conventions, where Data Transfer Objects can be used in application? Which layers? Or such kind of entities can be accessible through all application's layers? What is the best practice for DTOs?

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

    gosh that's alot of manual setting up, is gRPC that new on the market?
    Great explanations though, so clear👌

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

    Why ts-proto is not dev dependency?😀

  • @mayori-engineering-hub
    @mayori-engineering-hub ปีที่แล้ว

    The use of grpc in not applied correctly

  • @whalewalker9176
    @whalewalker9176 11 หลายเดือนก่อน +1

    If you're using macOS and encounter the error 'zsh: command not found: protoc' while attempting to execute the command 'protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/auth.proto', you can resolve it by installing the Protocol Buffers compiler. Simply run 'brew install protobuf' assuming you have HomeBrew installed on your Mac. This will install the necessary compiler and resolve the issue.

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

      I did this, and now the content of my generated file is totally different from his own. Did you encounter that too?

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

    Why are you using streams to receive users why would you not use the pagination approach? Imagine if there are thousands of rows in database will u send all of it to consumer?

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

    Thank you Sir

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

    Thanks ❤

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

    thank yoooo bro

  • @mayori-engineering-hub
    @mayori-engineering-hub ปีที่แล้ว

    Why pnpm

    • @PavleJovanovic-gn3jw
      @PavleJovanovic-gn3jw ปีที่แล้ว

      It's much faster than npm, especially on warm starts, and it manages the packages better.

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

    i guess it s better to generate types atomically instead manually

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

    please pin the Proto node modules command, thanks for great tutorial

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

    .proto looks like writing a schema for graphql

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

    There is no Angular here. Bait title? Incomplete upload? 🤷🏼

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

    how do window users solve this issue for protoc compiler $ protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./--ts_proto_opt=nestjs=true ./proto/adminauth.proto
    --ts_proto_out: protoc-gen-ts_proto: %1 is not a valid Win32 application.

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

      You will have to use the full path instead. For example:
      protoc --plugin=protoc-gen-ts_proto="C:\path\to\your\project\folder
      ode_modules\.bin\protoc-gen-ts_proto.cmd" --ts_proto_out=./ --ts_proto_opt=nestJs=true ./proto/auth.proto

    • @sekhar-oh6iq
      @sekhar-oh6iq 7 หลายเดือนก่อน

      It's working in windows machine but not generating the auth.ts file (proto to ts conversion), could you please help me out?