{"id":22097533,"url":"https://github.com/anazcodes/go-grpc-microservice","last_synced_at":"2026-05-04T08:36:32.787Z","repository":{"id":193102040,"uuid":"688132277","full_name":"anazcodes/go-grpc-microservice","owner":"anazcodes","description":"Developed 3 Microservices and 1 API Gateway which handles incoming HTTP requests. HTTP requests will be forwarded to these Microservices by gRPC. And implemented JWT for authentication.","archived":false,"fork":false,"pushed_at":"2023-09-16T09:06:57.000Z","size":158,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T07:43:03.154Z","etag":null,"topics":["go","grpc","jwt-authentication","microservices","postgresql","protocol-buffers"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anazcodes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-06T18:06:36.000Z","updated_at":"2024-10-06T17:30:49.000Z","dependencies_parsed_at":"2024-06-19T22:42:06.367Z","dependency_job_id":"64b90d6f-6d25-43cc-a76e-8f0d86a78098","html_url":"https://github.com/anazcodes/go-grpc-microservice","commit_stats":null,"previous_names":["anazibinurasheed/go-grpc-microservice","anazcodes/go-grpc-microservice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anazcodes%2Fgo-grpc-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anazcodes%2Fgo-grpc-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anazcodes%2Fgo-grpc-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anazcodes%2Fgo-grpc-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anazcodes","download_url":"https://codeload.github.com/anazcodes/go-grpc-microservice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245191848,"owners_count":20575291,"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","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":["go","grpc","jwt-authentication","microservices","postgresql","protocol-buffers"],"created_at":"2024-12-01T04:15:51.992Z","updated_at":"2025-10-26T02:45:26.650Z","avatar_url":"https://github.com/anazcodes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Go-grpc-microservice\n===\n\n\n\n## Overview\n\nAn example of small e-commerce system using Microservice Architecture. Developed 3 Microservices and 1 API Gateway which handles incoming HTTP requests. The HTTP requests will be forwarded to these Microservices using gRPC.\n##\n## Note: It's a Monorepo contains 1 api-gateway and 3 services.\n##\n\n## Application Infrastructure\n## 1. API Gateway:  \nHandles incoming HTTP requests\n\n## 2. Auth Service: \nProvides features such as Register, Login and generates Token by JWT and a feature called Validate to validate the token.\n\n## 3. Product Service:\n Provides features such as Add Product, Decrease Stock and Find Product.\n\n## 4. Order Service: \nThe only feature we ship in this Microservice is Create Order.\n\n## Technology/Architecture\n- Postgresql\n- gRPC\n- Protocol buffers\n- JWT\n- Microservice Architecture\n\n## Configurations\n\nEach standalone project have its own config package and env file make changes according to you.\n\n\n## Create Database \n\nCreate database for each service.\n  ```\n$ psql postgres\n$ CREATE DATABASE auth_svc;\n$ CREATE DATABASE order_svc;\n$ CREATE DATABASE product_svc;\n$ \\l\n$ \\q\n  ```\n\n\n## Install Dependencies \n- Install make\n  ```\n  sudo apt update\n\n  sudo apt install make  \n  ```\n- Install go deps\n  ```\n  make tidy\n  ```\n\n- for run\n  ```\n  make server\n  ```\n\n\n## Directory Hierarchy\n```\n|—— LICENSE\n|—— go-grpc-api-gateway\n|    |—— .gitignore\n|    |—— Makefile\n|    |—— cmd\n|        |—— main.go\n|    |—— go.mod\n|    |—— go.sum\n|    |—— notes.txt\n|    |—— pkg\n|        |—— auth\n|            |—— client.go\n|            |—— middleware.go\n|            |—— pb\n|                |—— auth.pb.go\n|                |—— auth.proto\n|                |—— auth_grpc.pb.go\n|            |—— routes\n|                |—— login.go\n|                |—— register.go\n|            |—— routes.go\n|        |—— config\n|            |—— config.go\n|            |—— envs\n|                |—— dev.env\n|        |—— order\n|            |—— client.go\n|            |—— pb\n|                |—— order.pb.go\n|                |—— order.proto\n|                |—— order_grpc.pb.go\n|            |—— routes\n|                |—— create_order.go\n|            |—— routes.go\n|        |—— product\n|            |—— client.go\n|            |—— pb\n|                |—— product.pb.go\n|                |—— product.proto\n|                |—— product_grpc.pb.go\n|            |—— routes\n|                |—— create_product.go\n|                |—— find_one.go\n|            |—— routes.go\n|—— go-grpc-auth-svc\n|    |—— .gitignore\n|    |—— Makefile\n|    |—— cmd\n|        |—— main.go\n|    |—— go.mod\n|    |—— go.sum\n|    |—— notes.txt\n|    |—— pkg\n|        |—— config\n|            |—— config.go\n|            |—— envs\n|                |—— dev.env\n|        |—— db\n|            |—— db.go\n|        |—— models\n|            |—— auth.go\n|        |—— pb\n|            |—— auth.pb.go\n|            |—— auth.proto\n|            |—— auth_grpc.pb.go\n|        |—— services\n|            |—— auth.go\n|        |—— utils\n|            |—— hash.go\n|            |—— jwt.go\n|—— go-grpc-order-svc\n|    |—— Makefile\n|    |—— cmd\n|        |—— main.go\n|    |—— go.mod\n|    |—— go.sum\n|    |—— pkg\n|        |—— client\n|            |—— product_client.go\n|        |—— config\n|            |—— config.go\n|            |—— envs\n|                |—— dev.env\n|        |—— db\n|            |—— db.go\n|        |—— models\n|            |—— order.go\n|        |—— pb\n|            |—— order.pb.go\n|            |—— order.proto\n|            |—— order_grpc.pb.go\n|            |—— product.pb.go\n|            |—— product.proto\n|            |—— product_grpc.pb.go\n|        |—— services\n|            |—— order.go\n|—— go-grpc-product-svc\n|    |—— .gitignore\n|    |—— Makefile\n|    |—— cmd\n|        |—— main.go\n|    |—— go.mod\n|    |—— go.sum\n|    |—— notes.txt\n|    |—— pkg\n|        |—— config\n|            |—— config.go\n|            |—— envs\n|                |—— dev.env\n|        |—— db\n|            |—— db.go\n|        |—— models\n|            |—— product.go\n|            |—— stock_decrease_log.go\n|        |—— pb\n|            |—— product.pb.go\n|            |—— product.proto\n|            |—— product_grpc.pb.go\n|        |—— services\n|            |—— product.go\n|—— readme.MD\n```\n## Code Details\n\n\n### Tested Platform\n- software\n  ```\n  OS: Ubuntu \n  Go: 1.18.1 \n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanazcodes%2Fgo-grpc-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanazcodes%2Fgo-grpc-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanazcodes%2Fgo-grpc-microservice/lists"}