# shubratodn/microservice_keycloak architecture

> Architecture diagram of the GitHub repository shubratodn/microservice_keycloak, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shubratodn/microservice_keycloak
- Repository: https://github.com/shubratodn/microservice_keycloak

## Overview

This repository implements a commerce backend as separate customer, product/category, and order services, with gateway, configuration-server, and discovery applications also present. The visible workflow is an HTTP request reaching a domain controller, which delegates to a service; order creation additionally checks customer and product eligibility before saving the order. The sampled code supports these calls and the customer persistence path, but gateway routing and most product persistence details are not shown, so those relationships are omitted.

Main entry points: [`java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java`](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java) (Order orchestration), [`java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java`](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java) (Customer operations), [`java-services/customer/src/main/java/com/customer/controller/CustomerController.java`](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/controller/CustomerController.java) (Customer API), [`java-services/product/src/main/java/com/product/controller/ProductController.java`](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/controller/ProductController.java) (Product API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Commerce services"]
  node_customer_api["Customer API"]
  node_customer_logic["Customer operations"]
  node_customer_store[("Customer repository")]
  node_customer_model["Customer model<br/>[Customer.java]"]
  node_product_api["Product API"]
  node_product_logic["Product operations"]
  node_category_api["Category API"]
  node_category_logic["Category operations"]
  node_customer_service_remote["Customer service"]
  node_product_service_remote["Product service"]
end

subgraph group_platform["Service platform"]
  node_gateway["API gateway"]
  node_config["Config server"]
  node_discovery["Service discovery"]
end

subgraph group_orderflow["Order orchestration"]
  node_order_api["Order API"]
  node_order_logic["Order orchestration"]
  node_order_store[("Order repository")]
  node_order_customer_client["Customer client"]
  node_order_product_client["Product client<br/>[ProductClient.java]"]
end

node_user(("API client"))

node_user -->|"requests"| node_customer_api
node_user -->|"requests"| node_product_api
node_user -->|"requests"| node_category_api
node_user -->|"requests"| node_order_api
node_customer_api -->|"delegates to"| node_customer_logic
node_customer_logic -->|"reads and writes"| node_customer_store
node_customer_logic -->|"maps to"| node_customer_model
node_product_api -->|"delegates to"| node_product_logic
node_category_api -->|"delegates to"| node_category_logic
node_order_api -->|"delegates to"| node_order_logic
node_order_logic -->|"saves and queries"| node_order_store
node_order_logic -->|"checks customer"| node_order_customer_client
node_order_logic -->|"checks products"| node_order_product_client
node_order_customer_client -.->|"calls remotely"| node_customer_service_remote
node_order_product_client -.->|"calls remotely"| node_product_service_remote

click node_gateway "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/api-gateway/src/main/java/com/apigateway/ApiGatewayApplication.java"
click node_config "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/config-server/src/main/java/com/microservice/ConfigServerApplication.java"
click node_discovery "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/discovery/src/main/java/com/discovery/DiscoveryApplication.java"
click node_customer_api "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/controller/CustomerController.java"
click node_customer_logic "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java"
click node_customer_store "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/repository/CustomerRepository.java"
click node_customer_model "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/entity/Customer.java"
click node_product_api "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/controller/ProductController.java"
click node_product_logic "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/service/impl/ProductServiceImpl.java"
click node_category_api "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/controller/CategoryController.java"
click node_category_logic "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/service/impl/CategoryServiceImpl.java"
click node_order_api "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/controller/OrderController.java"
click node_order_logic "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java"
click node_order_store "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/repository/OrderRepository.java"
click node_order_customer_client "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/client/CustomerClient.java"
click node_order_product_client "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/client/ProductClient.java"
click node_customer_service_remote "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/controller/CustomerController.java"
click node_product_service_remote "https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/controller/ProductController.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_customer_api,node_customer_logic,node_customer_store,node_customer_model,node_product_api,node_product_logic,node_category_api,node_category_logic,node_customer_service_remote,node_product_service_remote,node_user toneBlue
class node_gateway,node_config,node_discovery toneAmber
class node_order_api,node_order_logic,node_order_store,node_order_customer_client,node_order_product_client toneMint
```

## Components

### Commerce services

- [Customer API](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/controller/CustomerController.java): `java-services/customer/src/main/java/com/customer/controller/CustomerController.java`
- [Customer operations](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java): `java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java`
- [Customer repository](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/repository/CustomerRepository.java): `java-services/customer/src/main/java/com/customer/repository/CustomerRepository.java`
- [Customer model](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/entity/Customer.java): `java-services/customer/src/main/java/com/customer/entity/Customer.java`
- [Product API](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/controller/ProductController.java): `java-services/product/src/main/java/com/product/controller/ProductController.java`
- [Product operations](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/service/impl/ProductServiceImpl.java): `java-services/product/src/main/java/com/product/service/impl/ProductServiceImpl.java`
- [Category API](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/controller/CategoryController.java): `java-services/product/src/main/java/com/product/controller/CategoryController.java`
- [Category operations](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/service/impl/CategoryServiceImpl.java): `java-services/product/src/main/java/com/product/service/impl/CategoryServiceImpl.java`
- [Customer service](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/customer/src/main/java/com/customer/controller/CustomerController.java): `java-services/customer/src/main/java/com/customer/controller/CustomerController.java`
- [Product service](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/product/src/main/java/com/product/controller/ProductController.java): `java-services/product/src/main/java/com/product/controller/ProductController.java`

### Service platform

- [API gateway](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/api-gateway/src/main/java/com/apigateway/ApiGatewayApplication.java): `java-services/api-gateway/src/main/java/com/apigateway/ApiGatewayApplication.java`
- [Config server](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/config-server/src/main/java/com/microservice/ConfigServerApplication.java): `java-services/config-server/src/main/java/com/microservice/ConfigServerApplication.java`
- [Service discovery](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/discovery/src/main/java/com/discovery/DiscoveryApplication.java): `java-services/discovery/src/main/java/com/discovery/DiscoveryApplication.java`

### Order orchestration

- [Order API](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/controller/OrderController.java): `java-services/order/src/main/java/com/order/controller/OrderController.java`
- [Order orchestration](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java): `java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java`
- [Order repository](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/repository/OrderRepository.java): `java-services/order/src/main/java/com/order/repository/OrderRepository.java`
- [Customer client](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/client/CustomerClient.java): `java-services/order/src/main/java/com/order/client/CustomerClient.java`
- [Product client](https://github.com/shubratodn/microservice_keycloak/blob/master/java-services/order/src/main/java/com/order/client/ProductClient.java): `java-services/order/src/main/java/com/order/client/ProductClient.java`

### Other components

- **API client**

## Connections

- API client → Customer API: requests (evidence: `java-services/customer/src/main/java/com/customer/controller/CustomerController.java`)
- API client → Product API: requests (evidence: `java-services/product/src/main/java/com/product/controller/ProductController.java`)
- API client → Category API: requests (evidence: `java-services/product/src/main/java/com/product/controller/CategoryController.java`)
- API client → Order API: requests (evidence: `java-services/order/src/main/java/com/order/controller/OrderController.java`)
- Customer API → Customer operations: delegates to (evidence: `java-services/customer/src/main/java/com/customer/controller/CustomerController.java`)
- Customer operations → Customer repository: reads and writes (evidence: `java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java`)
- Customer operations → Customer model: maps to (evidence: `java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java`)
- Product API → Product operations: delegates to (evidence: `java-services/product/src/main/java/com/product/controller/ProductController.java`)
- Category API → Category operations: delegates to (evidence: `java-services/product/src/main/java/com/product/controller/CategoryController.java`)
- Order API → Order orchestration: delegates to (evidence: `java-services/order/src/main/java/com/order/controller/OrderController.java`)
- Order orchestration → Order repository: saves and queries (evidence: `java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java`)
- Order orchestration → Customer client: checks customer (evidence: `java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java`)
- Order orchestration → Product client: checks products (evidence: `java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java`)
- Customer client → Customer service: calls remotely
- Product client → Product service: calls remotely
