{"id":20364178,"url":"https://github.com/mabuonomo/example-nestjs-microservices-grpc","last_synced_at":"2025-08-21T04:30:39.426Z","repository":{"id":38978928,"uuid":"229825876","full_name":"mabuonomo/example-nestjs-microservices-grpc","owner":"mabuonomo","description":"NestJS + gRPC: a multi microservices example","archived":false,"fork":false,"pushed_at":"2023-01-24T05:22:02.000Z","size":3649,"stargazers_count":184,"open_issues_count":65,"forks_count":23,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T03:37:36.470Z","etag":null,"topics":["docker","grpc","microservices","nestjs","nestjs-grpc","prisma","proto","protobuf"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mabuonomo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-23T21:33:34.000Z","updated_at":"2025-03-05T11:37:20.000Z","dependencies_parsed_at":"2023-02-13T18:01:38.278Z","dependency_job_id":null,"html_url":"https://github.com/mabuonomo/example-nestjs-microservices-grpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mabuonomo/example-nestjs-microservices-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabuonomo%2Fexample-nestjs-microservices-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabuonomo%2Fexample-nestjs-microservices-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabuonomo%2Fexample-nestjs-microservices-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabuonomo%2Fexample-nestjs-microservices-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mabuonomo","download_url":"https://codeload.github.com/mabuonomo/example-nestjs-microservices-grpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabuonomo%2Fexample-nestjs-microservices-grpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271424945,"owners_count":24757369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","grpc","microservices","nestjs","nestjs-grpc","prisma","proto","protobuf"],"created_at":"2024-11-15T00:10:22.557Z","updated_at":"2025-08-21T04:30:39.086Z","avatar_url":"https://github.com/mabuonomo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS + gRPC: a multi microservices example\n\nThis repo show as to configure a multi microservices stack in NestJS using gRPC in docker environment.\n\n## Docker Stack\n\n- 3 NestJS microservices\n- 1 NestJS client\n- 1 Prisma server\n- 1 DB MySQL\n\n\u003cimg src=\"assets/microservices.png\"\u003e\n\n## Run it!\n\n```bash\nmake init\ndocker-compose up\n```\n\nNavigate to\n\n```\nhttp://localhost:3000/test/client1\nhttp://localhost:3000/test/client2\n\nhttp://localhost:3000/test/client_prisma_add\nhttp://localhost:3000/test/client_prisma_get\n```\n\n## Protobuf (*.proto) builder\nThis project use ts-proto library to generate interfaces from *.proto files. \n\nJust add/edit some proto file into proto folder, then run:\n```sh\nmake proto_build\n```\n\nFor example, this proto file:\n```protobuf\nsyntax = \"proto3\";\nimport \"google/protobuf/empty.proto\";\n\npackage micr_prisma;\n\nservice MicrService {\n  rpc FindOne (google.protobuf.Empty) returns (UserList) {}\n  rpc Save (google.protobuf.Empty) returns (User) {}\n}\n\nmessage User {\n  string id = 1;\n  string name = 2;\n  string surname = 3;\n}\n\nmessage UserList {\n  repeated User users = 1;\n}\n```\n\ngenerate the following typescript code:\n```ts\n/* eslint-disable */\nimport { Empty } from './google/protobuf/empty';\n\n\nexport interface User {\n  id: string;\n  name: string;\n  surname: string;\n}\n\nexport interface UserList {\n  users: User[];\n}\n\nexport interface MicrService {\n\n  FindOne(request: Empty): Promise\u003cUserList\u003e;\n\n  Save(request: Empty): Promise\u003cUser\u003e;\n\n}\n```\nWe can use these interfaces in NestJS project easily.\n\n## Documentation\n\n- \u003ca href=\"https://mariobuonomo.dev/blog/tutorial-nestjs-microservices-grpc\"\u003eBlog\u003c/a\u003e\n\n## Thanks to\n\n- \u003ca href=\"https://nestjs.com/\"\u003eNestJS\u003c/a\u003e\n- \u003ca href=\"https://grpc.io/\"\u003egRPC\u003c/a\u003e\n- \u003ca href=\"https://www.prisma.io/\"\u003ePrisma.io\u003c/a\u003e\n- \u003ca href=\"https://github.com/stephenh/ts-proto\"\u003ets-proto\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabuonomo%2Fexample-nestjs-microservices-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmabuonomo%2Fexample-nestjs-microservices-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabuonomo%2Fexample-nestjs-microservices-grpc/lists"}