# kltn-fa26/be-backoffice-stockflow-commerce architecture

> Architecture diagram of the GitHub repository kltn-fa26/be-backoffice-stockflow-commerce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kltn-fa26/be-backoffice-stockflow-commerce
- Repository: https://github.com/kltn-fa26/be-backoffice-stockflow-commerce

## Overview

StockFlowCommerce is a Spring Boot modular monolith for furniture-manufacturer inventory management and e-commerce. A documented checkout flow enters through the order capability and synchronously reserves inventory through its public API, allowing both operations to share a transaction. The broader product also covers product and storefront management, procurement, warehouse fulfillment, identity and permissions, customer records, design, chat, notifications, payments, and reporting. Common modules provide security, auditing, storage, and web infrastructure. Several modules are represented by the README and tree only; their internal call links are therefore omitted.

Main entry points: [`src/main/java/com/stockflow/order`](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/order) (Orders), [`src/main/java/com/stockflow/inventory/internal/service/InventoryServiceImpl.java`](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/inventory/internal/service/InventoryServiceImpl.java) (Inventory And Reservations), [`src/main/java/com/stockflow/identity/internal/service/IdentityServiceImpl.java`](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/identity/internal/service/IdentityServiceImpl.java) (Identity And RBAC), [`src/main/java/com/stockflow/catalog`](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/catalog) (Catalog Pricing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Commerce"]
  node_customer["Customer Profiles"]
  node_product["Product Master<br/>[Product.java]"]
  node_catalog["Catalog Pricing"]
  node_order["Orders"]
  node_payment["Payments"]
end

subgraph group_operations["Stock Operations"]
  node_inventory["Inventory And Reservations"]
  node_warehouse["Warehouse"]
  node_fulfillment["Picking And Shipping"]
  node_procurement["Procurement And QC"]
end

subgraph group_people["Identity And Engagement"]
  node_identity["Identity And RBAC"]
  node_design["Design Studio"]
  node_chat["Customer Chat"]
  node_notification["Notifications"]
end

subgraph group_insights["Insights"]
  node_reporting["Reports And Dashboards"]
end

subgraph group_platform["Platform Services"]
  node_contracts["Domain Event Contracts"]
  node_security["Permissions And Data Scope"]
  node_audit["Audit Trail"]
  node_file_storage["File Storage<br/>[FileStorage.java]"]
  node_web["API And Web Plumbing"]
  node_database[("PostgreSQL")]
end

node_customer_actor(("Staff Or Shopper"))

node_customer_actor -.->|"places order"| node_order
node_order -->|"reserves stock"| node_inventory
node_customer_actor -.->|"signs in"| node_identity
node_customer_actor -.->|"browses catalog"| node_catalog
node_inventory -.->|"persists stock"| node_database
node_order -.->|"persists orders"| node_database
node_identity -.->|"persists identities"| node_database

click node_customer "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/customer"
click node_product "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/product/internal/domain/Product.java"
click node_catalog "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/catalog"
click node_order "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/order"
click node_payment "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/payment"
click node_inventory "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/inventory/internal/service/InventoryServiceImpl.java"
click node_warehouse "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/warehouse"
click node_fulfillment "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/fulfillment/internal/service/FulfillmentServiceImpl.java"
click node_procurement "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/procurement"
click node_identity "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/identity/internal/service/IdentityServiceImpl.java"
click node_design "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/design"
click node_chat "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/chat"
click node_notification "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/notification"
click node_reporting "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/reporting"
click node_contracts "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/contracts"
click node_security "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/common/security"
click node_audit "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/common/audit"
click node_file_storage "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/common/storage/FileStorage.java"
click node_web "https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/common/api"

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,node_product,node_catalog,node_order,node_payment toneBlue
class node_inventory,node_warehouse,node_fulfillment,node_procurement toneAmber
class node_identity,node_design,node_chat,node_notification toneMint
class node_reporting toneRose
class node_contracts,node_security,node_audit,node_file_storage,node_web,node_database,node_customer_actor toneIndigo
```

## Components

### Commerce

- [Customer Profiles](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/customer): `src/main/java/com/stockflow/customer`
- [Product Master](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/product/internal/domain/Product.java): `src/main/java/com/stockflow/product/internal/domain/Product.java`
- [Catalog Pricing](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/catalog): `src/main/java/com/stockflow/catalog`
- [Orders](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/order): `src/main/java/com/stockflow/order`
- [Payments](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/payment): `src/main/java/com/stockflow/payment`

### Stock Operations

- [Inventory And Reservations](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/inventory/internal/service/InventoryServiceImpl.java): `src/main/java/com/stockflow/inventory/internal/service/InventoryServiceImpl.java`
- [Warehouse](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/warehouse): `src/main/java/com/stockflow/warehouse`
- [Picking And Shipping](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/fulfillment/internal/service/FulfillmentServiceImpl.java): `src/main/java/com/stockflow/fulfillment/internal/service/FulfillmentServiceImpl.java`
- [Procurement And QC](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/procurement): `src/main/java/com/stockflow/procurement`

### Identity And Engagement

- [Identity And RBAC](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/identity/internal/service/IdentityServiceImpl.java): `src/main/java/com/stockflow/identity/internal/service/IdentityServiceImpl.java`
- [Design Studio](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/design): `src/main/java/com/stockflow/design`
- [Customer Chat](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/chat): `src/main/java/com/stockflow/chat`
- [Notifications](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/notification): `src/main/java/com/stockflow/notification`

### Insights

- [Reports And Dashboards](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/reporting): `src/main/java/com/stockflow/reporting`

### Platform Services

- [Domain Event Contracts](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/contracts): `src/main/java/com/stockflow/contracts`
- [Permissions And Data Scope](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/common/security): `src/main/java/com/stockflow/common/security`
- [Audit Trail](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/common/audit): `src/main/java/com/stockflow/common/audit`
- [File Storage](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/blob/main/src/main/java/com/stockflow/common/storage/FileStorage.java): `src/main/java/com/stockflow/common/storage/FileStorage.java`
- [API And Web Plumbing](https://github.com/kltn-fa26/be-backoffice-stockflow-commerce/tree/main/src/main/java/com/stockflow/common/api): `src/main/java/com/stockflow/common/api`
- **PostgreSQL**

### Other components

- **Staff Or Shopper**

## Connections

- Staff Or Shopper → Orders: places order
- Orders → Inventory And Reservations: reserves stock
- Staff Or Shopper → Identity And RBAC: signs in
- Staff Or Shopper → Catalog Pricing: browses catalog
- Inventory And Reservations → PostgreSQL: persists stock
- Orders → PostgreSQL: persists orders
- Identity And RBAC → PostgreSQL: persists identities
