# afreen707/chainloom architecture

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

- Interactive diagram: https://gitdiagram.com/afreen707/chainloom
- Repository: https://github.com/afreen707/chainloom

## Overview

ChainLoom is a supply-chain monitoring and management application. Users enter through a React dashboard and resource pages to review inventory and low-stock alerts, manage suppliers and purchase orders, and work with shipment records and supplier documents. The frontend calls a Spring Boot REST API; the documented backend layers expose these operations through controllers, services, repositories, and PostgreSQL entities, with S3 used for supplier documents. Several backend implementations and shipment UI details were not sampled, so those branches follow README capabilities and are shown without inferred internal call chains.

Main entry points: [`supplychain-iq-frontend/src/api/axiosConfig.js`](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/axiosConfig.js) (HTTP client), [`supplychain-iq-frontend/src/App.jsx`](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/App.jsx) (App routing), [`supplychain-iq-frontend/src/pages/Dashboard.jsx`](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/Dashboard.jsx) (Dashboard), [`supplychain-iq-frontend/src/api/supplierApi.js`](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/supplierApi.js) (Supplier and document calls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_app["App routing<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_products_ui["Product management<br/>[Products.jsx]"]
  node_suppliers_ui["Supplier management<br/>[Suppliers.jsx]"]
  node_orders_ui["Purchase orders<br/>[PurchaseOrders.jsx]"]
  node_api_client["HTTP client<br/>[axiosConfig.js]"]
  node_product_api["Product API calls<br/>[productApi.js]"]
  node_supplier_api["Supplier and document calls<br/>[supplierApi.js]"]
  node_order_api["Order API calls"]
end

subgraph group_api["REST API"]
  node_product_controller["Product endpoints"]
  node_supplier_controller["Supplier endpoints"]
  node_order_controller["Purchase order endpoints"]
  node_shipment_controller["Shipment endpoints"]
  node_document_controller["Document endpoints"]
end

subgraph group_domain["Supply-chain services"]
  node_product_service["Product operations"]
  node_supplier_service["Supplier operations"]
  node_order_service["Order operations"]
  node_shipment_service["Shipment operations"]
  node_data_model["Domain entities and DTOs"]
end

subgraph group_storage["Persistence and documents"]
  node_repositories["Data repositories"]
  node_postgres[("PostgreSQL")]
  node_s3_service["S3 document service<br/>[S3Service.java]"]
  node_aws_s3[("AWS S3")]
end

node_user(("Business user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_products_ui
node_app -->|"routes to"| node_suppliers_ui
node_app -->|"routes to"| node_orders_ui
node_dashboard -->|"requests data"| node_product_api
node_dashboard -->|"requests data"| node_supplier_api
node_dashboard -->|"requests data"| node_order_api
node_products_ui -->|"requests data"| node_product_api
node_suppliers_ui -->|"requests data"| node_supplier_api
node_product_api -->|"uses"| node_api_client
node_supplier_api -->|"uses"| node_api_client
node_order_api -.->|"uses"| node_api_client
node_api_client -->|"REST requests"| node_product_controller
node_api_client -->|"REST requests"| node_supplier_controller
node_api_client -->|"REST requests"| node_order_controller
node_api_client -->|"REST requests"| node_shipment_controller
node_supplier_api -->|"document requests"| node_document_controller
node_product_controller -->|"delegates to"| node_product_service
node_supplier_controller -->|"delegates to"| node_supplier_service
node_order_controller -->|"delegates to"| node_order_service
node_document_controller -->|"calls"| node_s3_service
node_product_service -->|"accesses"| node_repositories
node_product_service -->|"maps data"| node_data_model
node_repositories -->|"persists"| node_data_model
node_repositories -->|"reads and writes"| node_postgres
node_s3_service -->|"stores files"| node_aws_s3

click node_app "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/App.jsx"
click node_dashboard "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/Dashboard.jsx"
click node_products_ui "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/Products.jsx"
click node_suppliers_ui "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/Suppliers.jsx"
click node_orders_ui "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/PurchaseOrders.jsx"
click node_api_client "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/axiosConfig.js"
click node_product_api "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/productApi.js"
click node_supplier_api "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/supplierApi.js"
click node_order_api "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/purchaseOrderApi.js"
click node_product_controller "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/ProductController.java"
click node_supplier_controller "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/SupplierController.java"
click node_order_controller "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/PurchaseOrderController.java"
click node_shipment_controller "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/ShipmentController.java"
click node_document_controller "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/DocumentController.java"
click node_product_service "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ProductServiceImpl.java"
click node_supplier_service "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/SupplierServiceImpl.java"
click node_order_service "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/PurchaseOrderServiceImpl.java"
click node_shipment_service "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ShipmentServiceImpl.java"
click node_data_model "https://github.com/afreen707/chainloom/tree/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/entity"
click node_repositories "https://github.com/afreen707/chainloom/tree/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/repository"
click node_s3_service "https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/S3Service.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_app,node_dashboard,node_products_ui,node_suppliers_ui,node_orders_ui,node_api_client,node_product_api,node_supplier_api,node_order_api,node_user toneBlue
class node_product_controller,node_supplier_controller,node_order_controller,node_shipment_controller,node_document_controller toneAmber
class node_product_service,node_supplier_service,node_order_service,node_shipment_service,node_data_model toneMint
class node_repositories,node_postgres,node_s3_service,node_aws_s3 toneRose
```

## Components

### React frontend

- [App routing](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/App.jsx): `supplychain-iq-frontend/src/App.jsx`
- [Dashboard](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/Dashboard.jsx): `supplychain-iq-frontend/src/pages/Dashboard.jsx`
- [Product management](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/Products.jsx): `supplychain-iq-frontend/src/pages/Products.jsx`
- [Supplier management](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/Suppliers.jsx): `supplychain-iq-frontend/src/pages/Suppliers.jsx`
- [Purchase orders](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/pages/PurchaseOrders.jsx): `supplychain-iq-frontend/src/pages/PurchaseOrders.jsx`
- [HTTP client](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/axiosConfig.js): `supplychain-iq-frontend/src/api/axiosConfig.js`
- [Product API calls](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/productApi.js): `supplychain-iq-frontend/src/api/productApi.js`
- [Supplier and document calls](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/supplierApi.js): `supplychain-iq-frontend/src/api/supplierApi.js`
- [Order API calls](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-frontend/src/api/purchaseOrderApi.js): `supplychain-iq-frontend/src/api/purchaseOrderApi.js`

### REST API

- [Product endpoints](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/ProductController.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/ProductController.java`
- [Supplier endpoints](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/SupplierController.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/SupplierController.java`
- [Purchase order endpoints](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/PurchaseOrderController.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/PurchaseOrderController.java`
- [Shipment endpoints](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/ShipmentController.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/ShipmentController.java`
- [Document endpoints](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/DocumentController.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/DocumentController.java`

### Supply-chain services

- [Product operations](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ProductServiceImpl.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ProductServiceImpl.java`
- [Supplier operations](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/SupplierServiceImpl.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/SupplierServiceImpl.java`
- [Order operations](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/PurchaseOrderServiceImpl.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/PurchaseOrderServiceImpl.java`
- [Shipment operations](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ShipmentServiceImpl.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ShipmentServiceImpl.java`
- [Domain entities and DTOs](https://github.com/afreen707/chainloom/tree/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/entity): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/entity`

### Persistence and documents

- [Data repositories](https://github.com/afreen707/chainloom/tree/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/repository): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/repository`
- **PostgreSQL**
- [S3 document service](https://github.com/afreen707/chainloom/blob/main/supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/S3Service.java): `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/S3Service.java`
- **AWS S3**

### Other components

- **Business user**

## Connections

- Business user → App routing: uses (evidence: `supplychain-iq-frontend/src/App.jsx`)
- App routing → Dashboard: routes to (evidence: `supplychain-iq-frontend/src/App.jsx`)
- App routing → Product management: routes to (evidence: `supplychain-iq-frontend/src/App.jsx`)
- App routing → Supplier management: routes to (evidence: `supplychain-iq-frontend/src/App.jsx`)
- App routing → Purchase orders: routes to (evidence: `supplychain-iq-frontend/src/App.jsx`)
- Dashboard → Product API calls: requests data (evidence: `supplychain-iq-frontend/src/pages/Dashboard.jsx`)
- Dashboard → Supplier and document calls: requests data (evidence: `supplychain-iq-frontend/src/pages/Dashboard.jsx`)
- Dashboard → Order API calls: requests data (evidence: `supplychain-iq-frontend/src/pages/Dashboard.jsx`)
- Product management → Product API calls: requests data (evidence: `supplychain-iq-frontend/src/pages/Products.jsx`)
- Supplier management → Supplier and document calls: requests data (evidence: `supplychain-iq-frontend/src/pages/Suppliers.jsx`)
- Product API calls → HTTP client: uses (evidence: `supplychain-iq-frontend/src/api/productApi.js`)
- Supplier and document calls → HTTP client: uses (evidence: `supplychain-iq-frontend/src/api/supplierApi.js`)
- Order API calls → HTTP client: uses (evidence: `supplychain-iq-frontend/src/api/purchaseOrderApi.js`)
- HTTP client → Product endpoints: REST requests (evidence: `README.md`)
- HTTP client → Supplier endpoints: REST requests (evidence: `README.md`)
- HTTP client → Purchase order endpoints: REST requests (evidence: `README.md`)
- HTTP client → Shipment endpoints: REST requests (evidence: `README.md`)
- Supplier and document calls → Document endpoints: document requests (evidence: `supplychain-iq-frontend/src/api/supplierApi.js`)
- Product endpoints → Product operations: delegates to (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/ProductController.java`)
- Supplier endpoints → Supplier operations: delegates to (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/SupplierController.java`)
- Purchase order endpoints → Order operations: delegates to (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/PurchaseOrderController.java`)
- Document endpoints → S3 document service: calls (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/controller/DocumentController.java`)
- Product operations → Data repositories: accesses (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ProductServiceImpl.java`)
- Product operations → Domain entities and DTOs: maps data (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/ProductServiceImpl.java`)
- Data repositories → Domain entities and DTOs: persists (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/repository/ProductRepository.java`)
- Data repositories → PostgreSQL: reads and writes (evidence: `README.md`)
- S3 document service → AWS S3: stores files (evidence: `supplychain-iq-v2/supplychain-iq-backend/src/main/java/com/afreen/supplychain_iq/service/impl/S3Service.java`)
