{"id":31622854,"url":"https://github.com/sergicanet9/go-microservices-demo","last_synced_at":"2026-04-27T16:32:06.719Z","repository":{"id":313579561,"uuid":"1051610089","full_name":"sergicanet9/go-microservices-demo","owner":"sergicanet9","description":"A lightweight Go microservices demo showcasing gRPC and HTTP communication, built on top of the scv-go-tools library and using go-hexagonal-api as a backend service.","archived":false,"fork":false,"pushed_at":"2026-03-27T12:45:38.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T23:38:43.824Z","etag":null,"topics":["docker","go","grpc","hexagonal-architecture","microservices","mongodb","restapi"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergicanet9.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-06T11:04:52.000Z","updated_at":"2026-03-27T12:46:12.000Z","dependencies_parsed_at":"2025-09-07T04:20:59.131Z","dependency_job_id":null,"html_url":"https://github.com/sergicanet9/go-microservices-demo","commit_stats":null,"previous_names":["sergicanet9/go-microservices-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sergicanet9/go-microservices-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergicanet9%2Fgo-microservices-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergicanet9%2Fgo-microservices-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergicanet9%2Fgo-microservices-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergicanet9%2Fgo-microservices-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergicanet9","download_url":"https://codeload.github.com/sergicanet9/go-microservices-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergicanet9%2Fgo-microservices-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32345802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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","go","grpc","hexagonal-architecture","microservices","mongodb","restapi"],"created_at":"2025-10-06T17:36:11.059Z","updated_at":"2026-04-27T16:32:06.714Z","avatar_url":"https://github.com/sergicanet9.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-microservices-demo\n![CI](https://github.com/sergicanet9/go-microservices-demo/actions/workflows/ci.yml/badge.svg)\n\nA lightweight **Go microservices** demo showcasing gRPC and HTTP communication, built on top of the [scv-go-tools](https://github.com/sergicanet9/scv-go-tools) library and using [go-hexagonal-api](https://github.com/sergicanet9/go-hexagonal-api) as a backend service.\n\n## 🧩 System Components\n| Component           | Role            |  Integration     | Description                                                                                                                                                            |\n| ------------------- | --------------- | ---------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| user-management-api | gRPC + REST API | Docker Container | Provides user management and JWT authentication + authorization. Integrated via Docker Image from [go-hexagonal-api](https://github.com/sergicanet9/go-hexagonal-api). |\n| task-manager-api    | REST API        | Docker Container | Manages tasks for the logged in user. Authenticates user tokens and interacts with user-management-api via gRPC.                                                       |\n| health-api          | REST API        | Docker Container | Performs a complete system health check by calling the health endpoints in user-management-api by gRPC and task-manager-api by HTTP.                                   |\n| MongoDB             | Database        | Docker Container | Provides two different MongoDB databases to store users and tasks.                                                                                                     |\n| Nginx               | API Gateway    | Docker Container | Acts as an entrypoint for the distributed system, routing the HTTP traffic to the internal APIs.                                                                       |\n\n## 📈 Architecture Diagram\n```mermaid\n%%{init: {'theme': 'neutral'}}%%\ngraph TD\n    %% Styles\n    style NG fill:#87CEFA,stroke:#000,stroke-width:1px\n    style UM fill:#ADD8E6,stroke:#000,stroke-width:1px\n    style TM fill:#ADD8E6,stroke:#000,stroke-width:1px\n    style HA fill:#ADD8E6,stroke:#000,stroke-width:1px\n    style MDB-UM fill:#90EE90,stroke:#000,stroke-width:1px\n    style MDB-TM fill:#90EE90,stroke:#000,stroke-width:1px\n\n    subgraph  \n        subgraph \"API Gateway\"\n            NG[Nginx]\n        end\n\n        subgraph \"Services\"\n            UM[\"user-management-api (gRPC + HTTP)\"]\n            TM[\"task-manager-api (HTTP)\"]\n            HA[\"health-api (HTTP)\"]\n        end\n\n        subgraph \"Databases\"\n            MDB-UM[MongoDB]\n            MDB-TM[MongoDB]\n        end\n    end\n\n    %% HTTP traffic through Nginx\n    NG --\u003e|HTTP| UM\n    NG --\u003e|HTTP| TM\n    NG --\u003e|HTTP| HA\n\n    %% Internal communications\n    TM --\u003e|gRPC| UM\n    HA --\u003e|gRPC| UM\n    HA --\u003e|HTTP| TM\n\n    %% Database connections\n    UM --\u003e MDB-UM\n    TM --\u003e MDB-TM\n```\n\n## ⚙️ Other Components\n| Component     | Role        | Integration        | Description                                                                                                                                             |\n| ------------- | ----------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| common        | Shared code | Internal Go Module | HTTP and gRPC clients for inter-service communication.                                                                                                  |\n| test/e2e      | Testing     | Internal Go Module | End-to-end tests validating interactions across the system components.                                                                                  |\n| scv-go-tools  | Toolkit     | External Go Module | Toolkit for building REST and gRPC APIs. Integrated via external Go module from [scv-go-tools](https://github.com/sergicanet9/scv-go-tools).            |\n| mongo-express | Utility     | Docker Container   | Web interface for MongoDB.                                                                                                                              |\n\n## 🏁 Getting Started\n### Run it with Docker\nTo start the entire application stack using Docker Compose, run:\n```\nmake up\n```\nThis command launches the Docker Images described above.\n\u003cbr /\u003e\nCheck the console output for Swagger UI, gRPC UIs and HTTP command examples, all routed through the Nginx API Gateway.\n\u003cbr/\u003e\nThe mongo-express URL is also displayed.\n\nTo stop and remove all containers, run:\n```\nmake down\n```\n\n### Debug it with VS Code\nThe project includes debugging profiles in [launch.json](https://github.com/sergicanet9/go-microservices-demo/blob/main/.vscode/launch.json) for both task-manager-api and health-api. Simply select the desired configuration in the VS Code debugger and run it.\n\nNOTES:\n- The database and the other APIs need to be up and running (run `make up`).\n- Configuration adjustments may be required to ensure full system integration while debugging one API locally.\n\n## 📦 API Endpoints\nAll the APIs are exposed through the Nginx API Gateway.\n\n### health-api\n| HTTP Endpoint               | Description                                   |\n| --------------------------- | --------------------------------------------- |\n| GET `/health-api/v1/health` | Returns the health status of all system APIs. |\n\n### task-manager-api\nThese endpoints require a valid JWT issued by User Management API, formatted as `Bearer {token}` and included as `Authorization` header.\n| HTTP Endpoint                            | Description                                    |\n| ---------------------------------------- | ---------------------------------------------- |\n| GET `/task-manager-api/v1/tasks`         | Gets all the tasks for the authenticated user. |\n| POST `/task-manager-api/v1/tasks`        | Creates a new task for the authenticated user. |\n| DELETE `/task-manager-api/v1/tasks/{id}` | Deletes a task for the authenticated user.     |\n\n### user-management-api\nEndpoints described in [go-hexagonal-api Endpoints](https://github.com/sergicanet9/go-hexagonal-api?tab=readme-ov-file#-api-endpoints), prefixed with `/user-management-api`. \n\n## ✅ Testing\n### Run all unit tests\n```\nmake all-test-unit\n```\n\n### Run End-to-End tests\n```\nmake test-e2e\n```\n\u003cbr /\u003e\n\n NOTES:\n- The entire application stack needs to be up and running (run `make up`).\n\n## ✍️ Author\nSergi Canet Vela\n\n## ⚖️ License\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergicanet9%2Fgo-microservices-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergicanet9%2Fgo-microservices-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergicanet9%2Fgo-microservices-demo/lists"}