{"id":28408115,"url":"https://github.com/rafaelfgx/microservices","last_synced_at":"2026-05-10T03:32:44.460Z","repository":{"id":295321930,"uuid":"984733323","full_name":"rafaelfgx/Microservices","owner":"rafaelfgx","description":"Clean Architecture, Event-Driven Architecture, Clean Code, SOLID Principles, Resilience, Idempotency, Folder-by-Feature, Patterns (Mediator, Result, Strategy, Outbox, Retry, Circuit Breaker), Java, Spring Boot, Kong, Keycloak, Kafka, MongoDB, Redis, Elastic, Kibana, Swagger, Docker.","archived":false,"fork":false,"pushed_at":"2025-06-09T11:56:43.000Z","size":1365,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T12:46:09.316Z","etag":null,"topics":["circuit-breaker-pattern","clean-architecture","clean-code","elasticsearch","event-driven-architecture","java","kafka","keycloak","kong","mediator-pattern","mongodb","outbox-pattern","redis","retry-pattern","solid","spring-boot","strategy-pattern"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"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/rafaelfgx.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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}},"created_at":"2025-05-16T12:19:34.000Z","updated_at":"2025-06-09T11:56:46.000Z","dependencies_parsed_at":"2025-05-24T22:56:23.595Z","dependency_job_id":"5c8deecb-51ea-4c60-aaad-75dd8c9de983","html_url":"https://github.com/rafaelfgx/Microservices","commit_stats":null,"previous_names":["rafaelfgx/microservices"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelfgx%2FMicroservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelfgx%2FMicroservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelfgx%2FMicroservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelfgx%2FMicroservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelfgx","download_url":"https://codeload.github.com/rafaelfgx/Microservices/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelfgx%2FMicroservices/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172133,"owners_count":22816514,"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":["circuit-breaker-pattern","clean-architecture","clean-code","elasticsearch","event-driven-architecture","java","kafka","keycloak","kong","mediator-pattern","mongodb","outbox-pattern","redis","retry-pattern","solid","spring-boot","strategy-pattern"],"created_at":"2025-06-02T02:09:37.303Z","updated_at":"2026-05-10T03:32:44.453Z","avatar_url":"https://github.com/rafaelfgx.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microservices\n\n![](https://github.com/rafaelfgx/Microservices/actions/workflows/build.yaml/badge.svg)\n\n![](https://repository-images.githubusercontent.com/984733323/c9dda1b0-6c40-4806-b2fc-2d0f14ec05db)\n\n## Ebooks\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://hotmart.com/product/microservices/X102617285D\"\u003e\n                \u003cimg src=\"https://hotmart.s3.amazonaws.com/product_pictures/01486abc-d26b-4125-a8ea-4b2a212e4a86/Cover.png\" /\u003e\n            \u003c/a\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://hotmart.com/pt-br/marketplace/produtos/microservices/A102616752Q\"\u003e\n                \u003cimg src=\"https://hotmart.s3.amazonaws.com/product_pictures/a2a7cc7f-de97-49fe-9fdb-1d6de5fe21a1/Cover.png\" /\u003e\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant AuthService\n    participant CustomerService\n    participant ProductService\n    participant OrderService\n    participant PaymentService\n    participant Kafka\n\n    Client-\u003e\u003eAuthService: POST /auth\n    AuthService--\u003e\u003eClient: JWT\n\n    Client-\u003e\u003eCustomerService: POST /customers\n    CustomerService--\u003e\u003eClient: Customer Created\n\n    Client-\u003e\u003eProductService: POST /products\n    ProductService--\u003e\u003eClient: Product Created\n\n    Client-\u003e\u003eOrderService: POST /orders\n    OrderService--\u003e\u003eClient: Order Created\n    OrderService-\u003e\u003eKafka: OrderEvent Published\n\n    Kafka--\u003e\u003ePaymentService: OrderEvent Consumed\n    Note right of PaymentService: Payment Created\n\n    Client-\u003e\u003ePaymentService: PUT /payments/order/{orderId}/status/{status}\n    PaymentService--\u003e\u003eClient: Payment Status Updated\n    PaymentService-\u003e\u003eKafka: PaymentEvent Published\n\n    Kafka--\u003e\u003eOrderService: PaymentEvent Consumed\n    Note right of OrderService: Status Updated\n```\n\n## Architecture, Design and Principles\n\n- [Screaming Architecture](https://blog.cleancoder.com/uncle-bob/2011/09/30/Screaming-Architecture.html)\n- [Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)\n- [Event-Driven Architecture](https://martinfowler.com/articles/201701-event-driven.html)\n- [Clean Code](https://www.oreilly.com/library/view/clean-code-a/9780136083238)\n- [Domain-Driven Design](https://martinfowler.com/bliki/DomainDrivenDesign.html)\n- [SOLID Principles](https://www.baeldung.com/solid-principles)\n- [Separation of Concerns](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)\n- [Common Closure Principle](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)\n- [Common Reuse Principle](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)\n- [Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html)\n\n## Patterns\n\n- [Ambassador Pattern](https://www.geeksforgeeks.org/system-design/ambassador-pattern-in-distributed-systems)\n- [Circuit Breaker Pattern](https://www.geeksforgeeks.org/circuit-breaker-vs-retry-pattern)\n- [Mediator Pattern](https://refactoring.guru/design-patterns/mediator)\n- [Outbox Pattern](https://www.geeksforgeeks.org/outbox-pattern-for-reliable-messaging-system-design)\n- [Result Pattern](https://www.codingexplorations.com/blog/mastering-the-result-pattern-in-software-development)\n- [Retry Pattern](https://www.geeksforgeeks.org/circuit-breaker-vs-retry-pattern)\n- [Strategy Pattern](https://refactoring.guru/design-patterns/strategy)\n\n## Technologies and Tools\n\n- [Java](https://www.oracle.com/java)\n- [Spring Boot](https://spring.io/projects/spring-boot)\n- [Kong](https://konghq.com)\n- [Keycloak](https://www.keycloak.org)\n- [OAuth2](https://oauth.net/2)\n- [JWT](https://jwt.io)\n- [Kafka](https://kafka.apache.org)\n- [MongoDB](https://www.mongodb.com)\n- [Debezium](https://debezium.io)\n- [Redis](https://redis.io/)\n- [Elastic](https://www.elastic.co)\n- [Swagger](https://swagger.io)\n- [Testcontainers](https://testcontainers.com)\n- [Docker](https://www.docker.com)\n- [Kubernetes](https://kubernetes.io)\n\n## Docker\n\n`docker compose up --detach --build --remove-orphans`\n\n## Starter\n\nInstall Into Local Maven Repository: `mvn clean install`\n\n## Tools\n\n- **Kong:** `http://localhost:8002`\n\n- **Keycloak:** `http://localhost:8005` **Username:** `admin` **Password:** `password`\n\n- **Kafka:** `http://localhost:9000`\n\n- **Mongo:** `http://localhost:27018`\n\n- **Redis:** `http://localhost:6380`\n\n- **Logs:** `http://localhost:5601/app/management/data/index_management/data_streams`\n\n- **APM:** `http://localhost:5601/app/apm/services`\n\n## Services\n\n### AuthService\n\n**Localhost:** `http://localhost:8010`\n\n**Docker:** `http://localhost:9010`\n\n**Kong:** `http://localhost:8000/authservice`\n\n| Method                                             | Endpoint    | Description |\n|:--------------------------------------------------:|-------------|-------------|\n| ![GET](https://img.shields.io/badge/GET-green)     | /auth       | Get         |\n| ![POST](https://img.shields.io/badge/POST-blue)    | /auth       | Auth        |\n| ![POST](https://img.shields.io/badge/POST-blue)    | /users      | Save        |\n| ![DELETE](https://img.shields.io/badge/DELETE-red) | /users/{id} | Delete      |\n\n### ConfigurationService\n\n**Localhost:** `http://localhost:8015`\n\n**Docker:** `http://localhost:9015`\n\n**Kong:** `http://localhost:8000/configurationservice`\n\n| Method                                              | Endpoint                           | Description   |\n|:---------------------------------------------------:|------------------------------------|---------------|\n| ![GET](https://img.shields.io/badge/GET-green)      | /configurations                    | List          |\n| ![GET](https://img.shields.io/badge/GET-green)      | /configurations/{id}               | Get           |\n| ![POST](https://img.shields.io/badge/POST-blue)     | /configurations                    | Create        |\n| ![DELETE](https://img.shields.io/badge/DELETE-red)  | /configurations/{id}               | Delete        |\n| ![PATCH](https://img.shields.io/badge/PATCH-purple) | /configurations/{id}/value/{value} | Update Value  |\n| ![POST](https://img.shields.io/badge/POST-blue)     | /configurations/broadcast          | Broadcast     |\n\n### CustomerService\n\n**Localhost:** `http://localhost:8020`\n\n**Docker:** `http://localhost:9020`\n\n**Kong:** `http://localhost:8000/customerservice`\n\n| Method                                             | Endpoint        | Description |\n|:--------------------------------------------------:|-----------------|-------------|\n| ![GET](https://img.shields.io/badge/GET-green)     | /customers      | List        |\n| ![GET](https://img.shields.io/badge/GET-green)     | /customers/{id} | Get         |\n| ![POST](https://img.shields.io/badge/POST-blue)    | /customers      | Create      |\n| ![PUT](https://img.shields.io/badge/PUT-orange)    | /customers/{id} | Update      |\n| ![DELETE](https://img.shields.io/badge/DELETE-red) | /customers/{id} | Delete      |\n\n### ProductService\n\n**Localhost:** `http://localhost:8025`\n\n**Docker:** `http://localhost:9025`\n\n**Kong:** `http://localhost:8000/productservice`\n\n| Method                                             | Endpoint       | Description |\n|:--------------------------------------------------:|----------------|-------------|\n| ![GET](https://img.shields.io/badge/GET-green)     | /products      | List        |\n| ![GET](https://img.shields.io/badge/GET-green)     | /products/{id} | Get         |\n| ![POST](https://img.shields.io/badge/POST-blue)    | /products      | Create      |\n| ![PUT](https://img.shields.io/badge/PUT-orange)    | /products/{id} | Update      |\n| ![DELETE](https://img.shields.io/badge/DELETE-red) | /products/{id} | Delete      |\n\n### OrderService\n\n**Localhost:** `http://localhost:8030`\n\n**Docker:** `http://localhost:9030`\n\n**Kong:** `http://localhost:8000/orderservice`\n\n| Method                                          | Endpoint     | Description |\n|:-----------------------------------------------:|--------------|-------------|\n| ![GET](https://img.shields.io/badge/GET-green)  | /orders      | List        |\n| ![GET](https://img.shields.io/badge/GET-green)  | /orders/{id} | Get         |\n| ![POST](https://img.shields.io/badge/POST-blue) | /orders      | Create      |\n\n### PaymentService\n\n**Localhost:** `http://localhost:8035`\n\n**Docker:** `http://localhost:9035`\n\n**Kong:** `http://localhost:8000/paymentservice`\n\n| Meth    od                                          | Endpoint                                  | Description     |\n|-----------------------------------------------------|-------------------------------------------|-----------------|\n| ![GET](https://img.shields.io/badge/GET-green)      | /payments                                 | List            |\n| ![GET](https://img.shields.io/badge/GET-green)      | /payments/{id}                            | Get             |\n| ![GET](https://img.shields.io/badge/GET-green)      | /payments/order/{orderId}                 | Get By Order Id |\n| ![PATCH](https://img.shields.io/badge/PATCH-purple) | /payments/order/{orderId}/status/{status} | Update Status   |\n\n## Examples\n\n### Cache\n\n```java\n@Service\npublic class ProductService {\n    @Cacheable(value = \"products\")\n    public List\u003cProduct\u003e get() {\n        return repository.findAll();\n    }\n\n    @Cacheable(value = \"products\", key = \"#id\")\n    public Optional\u003cProduct\u003e get(final UUID id) {\n        return repository.findById(id);\n    }\n\n    @CachePut(value = \"products\", key = \"#product.id\")\n    public Product save(final Product product) {\n        return repository.save(product);\n    }\n\n    @CacheEvict(value = \"products\", key = \"#id\")\n    public void delete(final UUID id) {\n        repository.deleteById(id);\n    }\n\n    @CacheEvict(value = \"products\", allEntries = true)\n    public void delete() {\n        repository.deleteAll();\n    }\n}\n```\n\n### Kafka\n\n```bash\necho KEY:{\"Key\":\"KEY\"} | docker exec -i kafka /opt/kafka/bin/kafka-console-producer.sh --bootstrap-server localhost:9094 --topic TOPIC --reader-property parse.key=true --reader-property key.separator=\":\"\n```\n\n```bash\ndocker exec -i kafka /opt/kafka/bin/kafka-console-consumer.sh --bootstrap-server localhost:9094 --topic TOPIC --from-beginning --formatter-property print.key=true --formatter-property key.separator=:\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelfgx%2Fmicroservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelfgx%2Fmicroservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelfgx%2Fmicroservices/lists"}