# alibabakutty/alibouali-ecommerce-microservice architecture

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

- Interactive diagram: https://gitdiagram.com/alibabakutty/alibouali-ecommerce-microservice
- Repository: https://github.com/alibabakutty/alibouali-ecommerce-microservice

## Overview

This is a Spring-based ecommerce microservices system. The principal workflow accepts an order, checks the customer, reserves products, saves the order and lines, requests payment, then publishes an order confirmation; payment separately persists its result and emits a payment notification. Customer and product management, authentication, and email notifications are distinct capabilities. The sampled code supports the order and payment calls, but deployment configuration, gateway routing, and Kafka consumer wiring were not shown, so those relationships are omitted or marked unverified.

Main entry points: [`services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java) (Order orchestration), [`services/customer/src/main/java/com/alibou/customer/controller/CustomerController.java`](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/customer/src/main/java/com/alibou/customer/controller/CustomerController.java) (Customer API), [`services/payment/src/main/java/com/alibou/ecommerce/service/PaymentService.java`](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/service/PaymentService.java) (Payment service), [`services/product/src/main/java/com/alibou/product/controller/ProductController.java`](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/product/src/main/java/com/alibou/product/controller/ProductController.java) (Product API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_auth["Authentication API"]
  node_customer_client_auth["Auth customer client"]
  node_gateway["API gateway"]
end

subgraph group_catalog["Customer and catalog"]
  node_customer_api["Customer API"]
  node_customer_service["Customer service"]
  node_customer_store[("Customer repository")]
  node_product_api["Product API"]
  node_product_service["Product service"]
  node_product_store[("Product repository")]
end

subgraph group_commerce["Order and payment"]
  node_order_api["Order API"]
  node_order_service["Order orchestration<br/>[OrderService.java]"]
  node_order_store[("Order repository")]
  node_order_lines["Order-line service"]
  node_customer_client_order["Order customer client"]
  node_product_client["Order product client<br/>[ProductClient.java]"]
  node_payment_client["Order payment client<br/>[PaymentClient.java]"]
  node_order_producer["Order event producer<br/>[OrderProducer.java]"]
  node_payment_api["Payment API"]
  node_payment_service["Payment service"]
  node_payment_store[("Payment repository")]
  node_payment_producer["Payment event producer"]
end

subgraph group_notify["Notifications"]
  node_notification_consumer["Notification consumer"]
  node_email_service["Gmail email service"]
  node_notification_api["Notification API"]
end

subgraph group_platform["Service platform"]
  node_discovery["Service discovery"]
  node_config["Configuration server"]
end

node_shopper(("Shopper or client"))
node_kafka["Kafka broker"]

node_shopper -->|"submits login"| node_auth
node_auth -.->|"authenticates via"| node_customer_client_auth
node_customer_client_auth -->|"fetches credentials"| node_customer_api
node_shopper -->|"manages customers"| node_customer_api
node_customer_api -->|"delegates to"| node_customer_service
node_customer_service -->|"reads and writes"| node_customer_store
node_shopper -->|"manages products"| node_product_api
node_product_api -->|"delegates to"| node_product_service
node_product_service -->|"reads and updates stock"| node_product_store
node_shopper -->|"places order"| node_order_api
node_order_api -->|"delegates to"| node_order_service
node_order_service -->|"checks customer"| node_customer_client_order
node_customer_client_order -.->|"fetches customer"| node_customer_api
node_order_service -->|"requests stock purchase"| node_product_client
node_product_client -.->|"purchases products"| node_product_api
node_order_service -->|"saves order"| node_order_store
node_order_service -->|"saves order lines"| node_order_lines
node_order_service -->|"requests payment"| node_payment_client
node_payment_client -.->|"submits payment"| node_payment_api
node_order_service -->|"publishes confirmation"| node_order_producer
node_order_producer -.->|"publishes event"| node_kafka
node_payment_api -->|"delegates to"| node_payment_service
node_payment_service -->|"saves payment"| node_payment_store
node_payment_service -->|"sends notification"| node_payment_producer
node_payment_producer -.->|"publishes event"| node_kafka
node_kafka -.->|"delivers event"| node_notification_consumer
node_notification_consumer -.->|"sends email"| node_email_service
node_shopper -->|"accesses notifications"| node_notification_api

click node_auth "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/authentication-service/src/main/java/com/alibou/authentication/controller/AuthenticationController.java"
click node_customer_client_auth "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/authentication-service/src/main/java/com/alibou/authentication/client/CustomerClient.java"
click node_gateway "https://github.com/alibabakutty/alibouali-ecommerce-microservice/tree/main/services/gateway/src/main/java/com/alibou/gateway"
click node_customer_api "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/customer/src/main/java/com/alibou/customer/controller/CustomerController.java"
click node_customer_service "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/customer/src/main/java/com/alibou/customer/service/CustomerService.java"
click node_customer_store "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/customer/src/main/java/com/alibou/customer/repository/CustomerRepository.java"
click node_product_api "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/product/src/main/java/com/alibou/product/controller/ProductController.java"
click node_product_service "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/product/src/main/java/com/alibou/product/service/ProductService.java"
click node_product_store "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/product/src/main/java/com/alibou/product/repository/ProductRepository.java"
click node_order_api "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/controller/OrderController.java"
click node_order_service "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java"
click node_order_store "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/repository/OrderRepository.java"
click node_order_lines "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/orderline/OrderLineService.java"
click node_customer_client_order "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/customer/CustomerClient.java"
click node_product_client "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/product/ProductClient.java"
click node_payment_client "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/payment/PaymentClient.java"
click node_order_producer "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/kafka/OrderProducer.java"
click node_payment_api "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/controller/PaymentController.java"
click node_payment_service "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/service/PaymentService.java"
click node_payment_store "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/repository/PaymentRepository.java"
click node_payment_producer "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/notification/NotificationProducer.java"
click node_notification_consumer "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/notification/src/main/java/com/alibou/ecommerce/kafka/NotificationConsumer.java"
click node_email_service "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/notification/src/main/java/com/alibou/ecommerce/email/gmail/GmailEmailService.java"
click node_notification_api "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/notification/src/main/java/com/alibou/ecommerce/controller/NotificationController.java"
click node_discovery "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/discovery/src/main/java/com/alibou/discovery/DiscoveryApplication.java"
click node_config "https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/config-server/src/main/java/com/alibou/config_server/ConfigServerApplication.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_auth,node_customer_client_auth,node_gateway,node_shopper toneBlue
class node_customer_api,node_customer_service,node_customer_store,node_product_api,node_product_service,node_product_store toneAmber
class node_order_api,node_order_service,node_order_store,node_order_lines,node_customer_client_order,node_product_client,node_payment_client,node_order_producer,node_payment_api,node_payment_service,node_payment_store,node_payment_producer toneMint
class node_notification_consumer,node_email_service,node_notification_api toneRose
class node_discovery,node_config,node_kafka toneIndigo
```

## Components

### Access and identity

- [Authentication API](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/authentication-service/src/main/java/com/alibou/authentication/controller/AuthenticationController.java): `services/authentication-service/src/main/java/com/alibou/authentication/controller/AuthenticationController.java`
- [Auth customer client](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/authentication-service/src/main/java/com/alibou/authentication/client/CustomerClient.java): `services/authentication-service/src/main/java/com/alibou/authentication/client/CustomerClient.java`
- [API gateway](https://github.com/alibabakutty/alibouali-ecommerce-microservice/tree/main/services/gateway/src/main/java/com/alibou/gateway): `services/gateway/src/main/java/com/alibou/gateway`

### Customer and catalog

- [Customer API](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/customer/src/main/java/com/alibou/customer/controller/CustomerController.java): `services/customer/src/main/java/com/alibou/customer/controller/CustomerController.java`
- [Customer service](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/customer/src/main/java/com/alibou/customer/service/CustomerService.java): `services/customer/src/main/java/com/alibou/customer/service/CustomerService.java`
- [Customer repository](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/customer/src/main/java/com/alibou/customer/repository/CustomerRepository.java): `services/customer/src/main/java/com/alibou/customer/repository/CustomerRepository.java`
- [Product API](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/product/src/main/java/com/alibou/product/controller/ProductController.java): `services/product/src/main/java/com/alibou/product/controller/ProductController.java`
- [Product service](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/product/src/main/java/com/alibou/product/service/ProductService.java): `services/product/src/main/java/com/alibou/product/service/ProductService.java`
- [Product repository](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/product/src/main/java/com/alibou/product/repository/ProductRepository.java): `services/product/src/main/java/com/alibou/product/repository/ProductRepository.java`

### Order and payment

- [Order API](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/controller/OrderController.java): `services/order/src/main/java/com/alibou/ecommerce/controller/OrderController.java`
- [Order orchestration](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java): `services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`
- [Order repository](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/repository/OrderRepository.java): `services/order/src/main/java/com/alibou/ecommerce/repository/OrderRepository.java`
- [Order-line service](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/orderline/OrderLineService.java): `services/order/src/main/java/com/alibou/ecommerce/orderline/OrderLineService.java`
- [Order customer client](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/customer/CustomerClient.java): `services/order/src/main/java/com/alibou/ecommerce/customer/CustomerClient.java`
- [Order product client](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/product/ProductClient.java): `services/order/src/main/java/com/alibou/ecommerce/product/ProductClient.java`
- [Order payment client](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/payment/PaymentClient.java): `services/order/src/main/java/com/alibou/ecommerce/payment/PaymentClient.java`
- [Order event producer](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/order/src/main/java/com/alibou/ecommerce/kafka/OrderProducer.java): `services/order/src/main/java/com/alibou/ecommerce/kafka/OrderProducer.java`
- [Payment API](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/controller/PaymentController.java): `services/payment/src/main/java/com/alibou/ecommerce/controller/PaymentController.java`
- [Payment service](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/service/PaymentService.java): `services/payment/src/main/java/com/alibou/ecommerce/service/PaymentService.java`
- [Payment repository](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/repository/PaymentRepository.java): `services/payment/src/main/java/com/alibou/ecommerce/repository/PaymentRepository.java`
- [Payment event producer](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/payment/src/main/java/com/alibou/ecommerce/notification/NotificationProducer.java): `services/payment/src/main/java/com/alibou/ecommerce/notification/NotificationProducer.java`

### Notifications

- [Notification consumer](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/notification/src/main/java/com/alibou/ecommerce/kafka/NotificationConsumer.java): `services/notification/src/main/java/com/alibou/ecommerce/kafka/NotificationConsumer.java`
- [Gmail email service](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/notification/src/main/java/com/alibou/ecommerce/email/gmail/GmailEmailService.java): `services/notification/src/main/java/com/alibou/ecommerce/email/gmail/GmailEmailService.java`
- [Notification API](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/notification/src/main/java/com/alibou/ecommerce/controller/NotificationController.java): `services/notification/src/main/java/com/alibou/ecommerce/controller/NotificationController.java`

### Service platform

- [Service discovery](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/discovery/src/main/java/com/alibou/discovery/DiscoveryApplication.java): `services/discovery/src/main/java/com/alibou/discovery/DiscoveryApplication.java`
- [Configuration server](https://github.com/alibabakutty/alibouali-ecommerce-microservice/blob/main/services/config-server/src/main/java/com/alibou/config_server/ConfigServerApplication.java): `services/config-server/src/main/java/com/alibou/config_server/ConfigServerApplication.java`

### Other components

- **Shopper or client**
- **Kafka broker**

## Connections

- Shopper or client → Authentication API: submits login (evidence: `services/authentication-service/src/main/java/com/alibou/authentication/controller/AuthenticationController.java`)
- Authentication API → Auth customer client: authenticates via
- Auth customer client → Customer API: fetches credentials (evidence: `services/authentication-service/src/main/java/com/alibou/authentication/client/CustomerClient.java`)
- Shopper or client → Customer API: manages customers (evidence: `services/customer/src/main/java/com/alibou/customer/controller/CustomerController.java`)
- Customer API → Customer service: delegates to (evidence: `services/customer/src/main/java/com/alibou/customer/controller/CustomerController.java`)
- Customer service → Customer repository: reads and writes (evidence: `services/customer/src/main/java/com/alibou/customer/service/CustomerService.java`)
- Shopper or client → Product API: manages products (evidence: `services/product/src/main/java/com/alibou/product/controller/ProductController.java`)
- Product API → Product service: delegates to (evidence: `services/product/src/main/java/com/alibou/product/controller/ProductController.java`)
- Product service → Product repository: reads and updates stock (evidence: `services/product/src/main/java/com/alibou/product/service/ProductService.java`)
- Shopper or client → Order API: places order (evidence: `services/order/src/main/java/com/alibou/ecommerce/controller/OrderController.java`)
- Order API → Order orchestration: delegates to (evidence: `services/order/src/main/java/com/alibou/ecommerce/controller/OrderController.java`)
- Order orchestration → Order customer client: checks customer (evidence: `services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`)
- Order customer client → Customer API: fetches customer
- Order orchestration → Order product client: requests stock purchase (evidence: `services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`)
- Order product client → Product API: purchases products
- Order orchestration → Order repository: saves order (evidence: `services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`)
- Order orchestration → Order-line service: saves order lines (evidence: `services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`)
- Order orchestration → Order payment client: requests payment (evidence: `services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`)
- Order payment client → Payment API: submits payment
- Order orchestration → Order event producer: publishes confirmation (evidence: `services/order/src/main/java/com/alibou/ecommerce/service/OrderService.java`)
- Order event producer → Kafka broker: publishes event
- Payment API → Payment service: delegates to (evidence: `services/payment/src/main/java/com/alibou/ecommerce/controller/PaymentController.java`)
- Payment service → Payment repository: saves payment (evidence: `services/payment/src/main/java/com/alibou/ecommerce/service/PaymentService.java`)
- Payment service → Payment event producer: sends notification (evidence: `services/payment/src/main/java/com/alibou/ecommerce/service/PaymentService.java`)
- Payment event producer → Kafka broker: publishes event
- Kafka broker → Notification consumer: delivers event
- Notification consumer → Gmail email service: sends email
- Shopper or client → Notification API: accesses notifications (evidence: `services/notification/src/main/java/com/alibou/ecommerce/controller/NotificationController.java`)
