# miladsrc/ecommerce-microservice architecture

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

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

## Overview

This is a Spring Boot e-commerce backend migrating from a monolith toward microservices. Users call services directly: authentication and authorization, account management, product catalog, and shopping-cart/checkout are separate documented responsibilities. The README shows PostgreSQL shared by the services and notes that user and security currently share a database. The tree supports these service boundaries, but no source excerpts were provided, so internal calls and data-access details are not asserted.

Main entry points: [`security/src/main/java/com/example/ecommerce`](https://github.com/miladsrc/ecommerce-microservice/tree/main/security/src/main/java/com/example/ecommerce) (Authentication), [`user/src/main/java/com/example/ecommerce/user`](https://github.com/miladsrc/ecommerce-microservice/tree/main/user/src/main/java/com/example/ecommerce/user) (User Accounts), [`product/src/main/java/com/example/ecommerce/product`](https://github.com/miladsrc/ecommerce-microservice/tree/main/product/src/main/java/com/example/ecommerce/product) (Product Catalog), [`shopping-cart/src/main/java/com/example/ecommerce/shopping-cart`](https://github.com/miladsrc/ecommerce-microservice/tree/main/shopping-cart/src/main/java/com/example/ecommerce/shopping-cart) (Cart & Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared Framework"]
  node_framework["Shared Code"]
end

subgraph group_identity["Identity Services"]
  node_security["Authentication"]
  node_user["User Accounts"]
end

subgraph group_commerce["Commerce Services"]
  node_product["Product Catalog"]
  node_cart["Cart &amp; Checkout"]
end

node_customer(("Client"))
node_postgres[("PostgreSQL")]

node_customer -->|"calls directly"| node_security
node_customer -->|"calls directly"| node_user
node_customer -->|"calls directly"| node_product
node_customer -->|"calls directly"| node_cart
node_security -->|"uses database"| node_postgres
node_user -->|"uses database"| node_postgres
node_product -->|"uses database"| node_postgres
node_cart -->|"uses database"| node_postgres

click node_framework "https://github.com/miladsrc/ecommerce-microservice/tree/main/framework"
click node_security "https://github.com/miladsrc/ecommerce-microservice/tree/main/security/src/main/java/com/example/ecommerce"
click node_user "https://github.com/miladsrc/ecommerce-microservice/tree/main/user/src/main/java/com/example/ecommerce/user"
click node_product "https://github.com/miladsrc/ecommerce-microservice/tree/main/product/src/main/java/com/example/ecommerce/product"
click node_cart "https://github.com/miladsrc/ecommerce-microservice/tree/main/shopping-cart/src/main/java/com/example/ecommerce/shopping-cart"

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_framework,node_customer toneBlue
class node_security,node_user,node_postgres toneAmber
class node_product,node_cart toneMint
```

## Components

### Shared Framework

- [Shared Code](https://github.com/miladsrc/ecommerce-microservice/tree/main/framework): `framework`

### Identity Services

- [Authentication](https://github.com/miladsrc/ecommerce-microservice/tree/main/security/src/main/java/com/example/ecommerce): `security/src/main/java/com/example/ecommerce`
- [User Accounts](https://github.com/miladsrc/ecommerce-microservice/tree/main/user/src/main/java/com/example/ecommerce/user): `user/src/main/java/com/example/ecommerce/user`

### Commerce Services

- [Product Catalog](https://github.com/miladsrc/ecommerce-microservice/tree/main/product/src/main/java/com/example/ecommerce/product): `product/src/main/java/com/example/ecommerce/product`
- [Cart & Checkout](https://github.com/miladsrc/ecommerce-microservice/tree/main/shopping-cart/src/main/java/com/example/ecommerce/shopping-cart): `shopping-cart/src/main/java/com/example/ecommerce/shopping-cart`

### Other components

- **Client**
- **PostgreSQL**

## Connections

- Client → Authentication: calls directly (evidence: `README.md`)
- Client → User Accounts: calls directly (evidence: `README.md`)
- Client → Product Catalog: calls directly (evidence: `README.md`)
- Client → Cart & Checkout: calls directly (evidence: `README.md`)
- Authentication → PostgreSQL: uses database (evidence: `README.md`)
- User Accounts → PostgreSQL: uses database (evidence: `README.md`)
- Product Catalog → PostgreSQL: uses database (evidence: `README.md`)
- Cart & Checkout → PostgreSQL: uses database (evidence: `README.md`)
