# q86865511/erpsystem architecture

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

- Interactive diagram: https://gitdiagram.com/q86865511/erpsystem
- Repository: https://github.com/q86865511/erpsystem

## Overview

This is a modular-monolith manufacturing ERP with a React client, Spring backend, and PostgreSQL persistence. The flagship workflow runs procurement through receipt and vendor billing, production through WIP issue and completion, and sales through shipment, invoicing, and collection; each business posting is documented as transactional with the ledger. Reporting reconciles inventory and AP/AR subledgers to GL balances. The graph preserves the documented HR, master-data, audit, and optional AI/MCP capabilities; unsampled module internals are represented at their exact directories, and links rely on README documentation where source excerpts were unavailable.

Main entry points: [`frontend/src/api/client.ts`](https://github.com/q86865511/erpsystem/blob/main/frontend/src/api/client.ts) (API client), [`src/main/java/com/erp/ledger`](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/ledger) (Double-entry ledger), [`src/main/java/com/erp/purchasing`](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/purchasing) (Procurement), [`src/main/java/com/erp/inventory`](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/inventory) (Inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["ERP interface"]
  node_featureui["Feature screens"]
  node_apiclient["API client<br/>[client.ts]"]
end

subgraph group_access["Access and assistance"]
  node_iam["Identity and RBAC"]
  node_assistant["ERP Copilot"]
  node_mcp["MCP access"]
end

subgraph group_operations["Operations"]
  node_masterdata["Master data"]
  node_purchasing["Procurement"]
  node_inventory["Inventory"]
  node_manufacturing["Manufacturing"]
  node_sales["Sales"]
  node_payments["Payments"]
end

subgraph group_finance["Finance and control"]
  node_ledger["Double-entry ledger"]
  node_reporting["Reports and reconciliation"]
  node_database[("PostgreSQL")]
end

subgraph group_support["Workforce and audit"]
  node_hr["Human resources"]
  node_audit["Audit trail"]
end

node_operator(("ERP user"))
node_anthropic(("Anthropic Claude"))
node_mcpuser(("Claude Desktop or Code"))

node_operator -->|"uses"| node_webapp
node_webapp -->|"renders"| node_featureui
node_featureui -->|"requests"| node_apiclient
node_apiclient -->|"authenticates"| node_iam
node_apiclient -->|"calls REST"| node_masterdata
node_apiclient -->|"calls REST"| node_purchasing
node_apiclient -->|"calls REST"| node_inventory
node_apiclient -->|"calls REST"| node_manufacturing
node_apiclient -->|"calls REST"| node_sales
node_apiclient -->|"calls REST"| node_payments
node_apiclient -->|"calls REST"| node_ledger
node_apiclient -->|"calls REST"| node_reporting
node_apiclient -->|"calls REST"| node_hr
node_purchasing -->|"posts receipt"| node_inventory
node_purchasing -->|"posts bills"| node_ledger
node_manufacturing -->|"issues and receives"| node_inventory
node_manufacturing -->|"posts WIP"| node_ledger
node_sales -->|"posts shipment"| node_inventory
node_sales -->|"posts invoices"| node_ledger
node_payments -->|"posts payments"| node_ledger
node_purchasing -->|"supplies payables"| node_payments
node_sales -->|"supplies receivables"| node_payments
node_ledger -->|"provides balances"| node_reporting
node_inventory -->|"provides subledger"| node_reporting
node_purchasing -->|"provides AP data"| node_reporting
node_sales -->|"provides AR data"| node_reporting
node_masterdata -->|"resolves master data"| node_purchasing
node_masterdata -->|"resolves master data"| node_inventory
node_reporting -->|"reads snapshot"| node_database
node_ledger -->|"stores postings"| node_database
node_operator -->|"asks questions"| node_assistant
node_assistant -->|"queries model"| node_anthropic
node_assistant -->|"executes REST tools"| node_apiclient
node_mcpuser -->|"connects"| node_mcp
node_mcp -->|"calls ERP API"| node_apiclient
node_hr -->|"posts payroll"| node_ledger
node_assistant -->|"records actions"| node_audit

click node_webapp "https://github.com/q86865511/erpsystem/tree/main/frontend/src"
click node_featureui "https://github.com/q86865511/erpsystem/tree/main/frontend/src/features"
click node_apiclient "https://github.com/q86865511/erpsystem/blob/main/frontend/src/api/client.ts"
click node_iam "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/iam"
click node_assistant "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/assistant"
click node_mcp "https://github.com/q86865511/erpsystem/tree/main/mcp-server/src"
click node_masterdata "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/masterdata"
click node_purchasing "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/purchasing"
click node_inventory "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/inventory"
click node_manufacturing "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/manufacturing"
click node_sales "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/sales"
click node_payments "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/payments"
click node_ledger "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/ledger"
click node_reporting "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/reporting"
click node_hr "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/hr"
click node_audit "https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/audit"

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_webapp,node_featureui,node_apiclient,node_operator toneBlue
class node_iam,node_assistant,node_mcp toneAmber
class node_masterdata,node_purchasing,node_inventory,node_manufacturing,node_sales,node_payments toneMint
class node_ledger,node_reporting,node_database toneRose
class node_hr,node_audit,node_anthropic,node_mcpuser toneIndigo
```

## Components

### Web client

- [ERP interface](https://github.com/q86865511/erpsystem/tree/main/frontend/src): `frontend/src`
- [Feature screens](https://github.com/q86865511/erpsystem/tree/main/frontend/src/features): `frontend/src/features`
- [API client](https://github.com/q86865511/erpsystem/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Access and assistance

- [Identity and RBAC](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/iam): `src/main/java/com/erp/iam`
- [ERP Copilot](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/assistant): `src/main/java/com/erp/assistant`
- [MCP access](https://github.com/q86865511/erpsystem/tree/main/mcp-server/src): `mcp-server/src`

### Operations

- [Master data](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/masterdata): `src/main/java/com/erp/masterdata`
- [Procurement](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/purchasing): `src/main/java/com/erp/purchasing`
- [Inventory](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/inventory): `src/main/java/com/erp/inventory`
- [Manufacturing](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/manufacturing): `src/main/java/com/erp/manufacturing`
- [Sales](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/sales): `src/main/java/com/erp/sales`
- [Payments](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/payments): `src/main/java/com/erp/payments`

### Finance and control

- [Double-entry ledger](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/ledger): `src/main/java/com/erp/ledger`
- [Reports and reconciliation](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/reporting): `src/main/java/com/erp/reporting`
- **PostgreSQL**

### Workforce and audit

- [Human resources](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/hr): `src/main/java/com/erp/hr`
- [Audit trail](https://github.com/q86865511/erpsystem/tree/main/src/main/java/com/erp/audit): `src/main/java/com/erp/audit`

### Other components

- **ERP user**
- **Anthropic Claude**
- **Claude Desktop or Code**

## Connections

- ERP user → ERP interface: uses (evidence: `README.md`)
- ERP interface → Feature screens: renders (evidence: `README.md`)
- Feature screens → API client: requests (evidence: `README.md`)
- API client → Identity and RBAC: authenticates (evidence: `README.md`)
- API client → Master data: calls REST (evidence: `README.md`)
- API client → Procurement: calls REST (evidence: `README.md`)
- API client → Inventory: calls REST (evidence: `README.md`)
- API client → Manufacturing: calls REST (evidence: `README.md`)
- API client → Sales: calls REST (evidence: `README.md`)
- API client → Payments: calls REST (evidence: `README.md`)
- API client → Double-entry ledger: calls REST (evidence: `README.md`)
- API client → Reports and reconciliation: calls REST (evidence: `README.md`)
- API client → Human resources: calls REST (evidence: `README.md`)
- Procurement → Inventory: posts receipt (evidence: `README.md`)
- Procurement → Double-entry ledger: posts bills (evidence: `README.md`)
- Manufacturing → Inventory: issues and receives (evidence: `src/main/java/com/erp/manufacturing/application/WorkOrderService.java`)
- Manufacturing → Double-entry ledger: posts WIP (evidence: `src/main/java/com/erp/manufacturing/application/WorkOrderService.java`)
- Sales → Inventory: posts shipment (evidence: `README.md`)
- Sales → Double-entry ledger: posts invoices (evidence: `README.md`)
- Payments → Double-entry ledger: posts payments (evidence: `README.md`)
- Procurement → Payments: supplies payables (evidence: `README.md`)
- Sales → Payments: supplies receivables (evidence: `README.md`)
- Double-entry ledger → Reports and reconciliation: provides balances (evidence: `README.md`)
- Inventory → Reports and reconciliation: provides subledger (evidence: `README.md`)
- Procurement → Reports and reconciliation: provides AP data (evidence: `README.md`)
- Sales → Reports and reconciliation: provides AR data (evidence: `README.md`)
- Master data → Procurement: resolves master data (evidence: `src/main/java/com/erp/purchasing/application/VendorBillService.java`)
- Master data → Inventory: resolves master data (evidence: `src/main/java/com/erp/inventory/application/InventoryQueryService.java`)
- Reports and reconciliation → PostgreSQL: reads snapshot (evidence: `README.md`)
- Double-entry ledger → PostgreSQL: stores postings (evidence: `README.md`)
- ERP user → ERP Copilot: asks questions (evidence: `README.md`)
- ERP Copilot → Anthropic Claude: queries model (evidence: `README.md`)
- ERP Copilot → API client: executes REST tools (evidence: `README.md`)
- Claude Desktop or Code → MCP access: connects (evidence: `README.md`)
- MCP access → API client: calls ERP API (evidence: `README.md`)
- Human resources → Double-entry ledger: posts payroll (evidence: `README.md`)
- ERP Copilot → Audit trail: records actions (evidence: `README.md`)
