# beboatef/dyehouse-rep- architecture

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

- Interactive diagram: https://gitdiagram.com/beboatef/dyehouse-rep-
- Repository: https://github.com/beboatef/dyehouse-rep-

## Overview

DyeHouseERP is a dye-house ERP spanning customer and supplier records, purchasing and receipts, raw-stock tracking, production, delivery, accounting, HR/payroll, approvals, and reporting. The typical interaction enters through the ASP.NET API, dispatches an application request, and reads or changes domain data through the application database abstraction. Sampled controller and query evidence supports the purchasing and inventory paths; other listed business areas are represented from the source tree, but their internal calls were not sampled, so those links are omitted.

Main entry points: [`DyeHouseERP/src/DyeHouseERP.Application/Common/Interfaces/IApplicationDbContext.cs`](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Application/Common/Interfaces/IApplicationDbContext.cs) (Application DB contract), [`DyeHouseERP/src/DyeHouseERP.API/Program.cs`](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Program.cs) (HTTP API), [`DyeHouseERP/src/DyeHouseERP.Web/src/App.tsx`](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Web/src/App.tsx) (Web client), [`DyeHouseERP/src/DyeHouseERP.API/Controllers/PurchasesController.cs`](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Controllers/PurchasesController.cs) (Purchasing endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interface and API"]
  node_web["Web client<br/>[App.tsx]"]
  node_api["HTTP API<br/>[Program.cs]"]
  node_purchase_api["Purchasing endpoints"]
  node_inventory_api["Inventory endpoints"]
end

subgraph group_operations["Production and inventory"]
  node_production["Production orders<br/>[ProductionOrders]"]
  node_formation["Formation requests<br/>[FormationRequests]"]
  node_stages["Production stages<br/>[ProductionStages]"]
  node_raw_receipts["Raw receipts<br/>[RawReceipts]"]
  node_materials["Materials<br/>[Materials]"]
  node_inventory["Stock traceability"]
  node_delivery["Deliveries<br/>[Deliveries]"]
  node_ready_goods["Ready goods<br/>[ReadyGoods]"]
end

subgraph group_commercial["Commercial operations"]
  node_purchasing["Purchasing<br/>[Purchases]"]
  node_customers["Customers<br/>[Customers]"]
  node_invoices["Invoicing<br/>[Invoices]"]
  node_customer_returns["Customer returns<br/>[CustomerReturns]"]
end

subgraph group_finance["Finance and governance"]
  node_treasury["Treasury<br/>[Treasury]"]
  node_payroll["HR and payroll<br/>[Payroll]"]
  node_costing["Cost accounting<br/>[CostAccounting]"]
  node_approvals["Approvals<br/>[Approvals]"]
  node_reports["Reports and dashboard<br/>[Reports]"]
  node_dashboard["Dashboard summary"]
end

subgraph group_core["Application and domain core"]
  node_app_db["Application DB contract"]
  node_domain["Domain entities<br/>[Entities]"]
  node_customer_entity["Customer rules<br/>[Customer.cs]"]
  node_delivery_entity["Delivery rules<br/>[Delivery.cs]"]
  node_formation_entity["Formation rules"]
  node_production_entity["Production rules<br/>[ProductionOrder.cs]"]
  node_material_entity["Material rules<br/>[Material.cs]"]
end

node_staff(("ERP user"))

node_staff -.->|"uses"| node_web
node_web -.->|"requests"| node_api
node_api -.->|"hosts"| node_purchase_api
node_api -.->|"hosts"| node_inventory_api
node_purchase_api -->|"dispatches"| node_purchasing
node_inventory_api -->|"dispatches"| node_inventory
node_inventory -->|"queries"| node_app_db
node_purchasing -.->|"uses"| node_app_db
node_dashboard -->|"queries"| node_app_db
node_approvals -->|"queries"| node_app_db
node_customers -.->|"uses"| node_customer_entity
node_delivery -.->|"uses"| node_delivery_entity
node_formation -.->|"uses"| node_formation_entity
node_production -.->|"uses"| node_production_entity
node_materials -.->|"uses"| node_material_entity

click node_web "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Web/src/App.tsx"
click node_api "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Program.cs"
click node_purchase_api "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Controllers/PurchasesController.cs"
click node_inventory_api "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Controllers/InventoryTraceabilityController.cs"
click node_production "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/ProductionOrders"
click node_formation "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/FormationRequests"
click node_stages "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/ProductionStages"
click node_raw_receipts "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/RawReceipts"
click node_materials "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Materials"
click node_inventory "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Application/Inventory/Queries/GetStockTraceabilityQuery.cs"
click node_delivery "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Deliveries"
click node_ready_goods "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/ReadyGoods"
click node_purchasing "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Purchases"
click node_customers "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Customers"
click node_invoices "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Invoices"
click node_customer_returns "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/CustomerReturns"
click node_treasury "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Treasury"
click node_payroll "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Payroll"
click node_costing "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/CostAccounting"
click node_approvals "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Approvals"
click node_reports "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Reports"
click node_dashboard "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Application/Dashboard/Queries/GetDashboardSummaryQuery.cs"
click node_app_db "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Application/Common/Interfaces/IApplicationDbContext.cs"
click node_domain "https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities"
click node_customer_entity "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/Customer.cs"
click node_delivery_entity "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/Delivery.cs"
click node_formation_entity "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/FormationRequest.cs"
click node_production_entity "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/ProductionOrder.cs"
click node_material_entity "https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/Material.cs"

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_web,node_api,node_purchase_api,node_inventory_api,node_staff toneBlue
class node_production,node_formation,node_stages,node_raw_receipts,node_materials,node_inventory,node_delivery,node_ready_goods toneAmber
class node_purchasing,node_customers,node_invoices,node_customer_returns toneMint
class node_treasury,node_payroll,node_costing,node_approvals,node_reports,node_dashboard toneRose
class node_app_db,node_domain,node_customer_entity,node_delivery_entity,node_formation_entity,node_production_entity,node_material_entity toneIndigo
```

## Components

### User interface and API

- [Web client](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Web/src/App.tsx): `DyeHouseERP/src/DyeHouseERP.Web/src/App.tsx`
- [HTTP API](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Program.cs): `DyeHouseERP/src/DyeHouseERP.API/Program.cs`
- [Purchasing endpoints](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Controllers/PurchasesController.cs): `DyeHouseERP/src/DyeHouseERP.API/Controllers/PurchasesController.cs`
- [Inventory endpoints](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.API/Controllers/InventoryTraceabilityController.cs): `DyeHouseERP/src/DyeHouseERP.API/Controllers/InventoryTraceabilityController.cs`

### Production and inventory

- [Production orders](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/ProductionOrders): `DyeHouseERP/src/DyeHouseERP.Application/ProductionOrders`
- [Formation requests](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/FormationRequests): `DyeHouseERP/src/DyeHouseERP.Application/FormationRequests`
- [Production stages](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/ProductionStages): `DyeHouseERP/src/DyeHouseERP.Application/ProductionStages`
- [Raw receipts](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/RawReceipts): `DyeHouseERP/src/DyeHouseERP.Application/RawReceipts`
- [Materials](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Materials): `DyeHouseERP/src/DyeHouseERP.Application/Materials`
- [Stock traceability](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Application/Inventory/Queries/GetStockTraceabilityQuery.cs): `DyeHouseERP/src/DyeHouseERP.Application/Inventory/Queries/GetStockTraceabilityQuery.cs`
- [Deliveries](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Deliveries): `DyeHouseERP/src/DyeHouseERP.Application/Deliveries`
- [Ready goods](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/ReadyGoods): `DyeHouseERP/src/DyeHouseERP.Application/ReadyGoods`

### Commercial operations

- [Purchasing](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Purchases): `DyeHouseERP/src/DyeHouseERP.Application/Purchases`
- [Customers](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Customers): `DyeHouseERP/src/DyeHouseERP.Application/Customers`
- [Invoicing](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Invoices): `DyeHouseERP/src/DyeHouseERP.Application/Invoices`
- [Customer returns](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/CustomerReturns): `DyeHouseERP/src/DyeHouseERP.Application/CustomerReturns`

### Finance and governance

- [Treasury](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Treasury): `DyeHouseERP/src/DyeHouseERP.Application/Treasury`
- [HR and payroll](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Payroll): `DyeHouseERP/src/DyeHouseERP.Application/Payroll`
- [Cost accounting](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/CostAccounting): `DyeHouseERP/src/DyeHouseERP.Application/CostAccounting`
- [Approvals](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Approvals): `DyeHouseERP/src/DyeHouseERP.Application/Approvals`
- [Reports and dashboard](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Application/Reports): `DyeHouseERP/src/DyeHouseERP.Application/Reports`
- [Dashboard summary](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Application/Dashboard/Queries/GetDashboardSummaryQuery.cs): `DyeHouseERP/src/DyeHouseERP.Application/Dashboard/Queries/GetDashboardSummaryQuery.cs`

### Application and domain core

- [Application DB contract](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Application/Common/Interfaces/IApplicationDbContext.cs): `DyeHouseERP/src/DyeHouseERP.Application/Common/Interfaces/IApplicationDbContext.cs`
- [Domain entities](https://github.com/beboatef/dyehouse-rep-/tree/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities): `DyeHouseERP/src/DyeHouseERP.Domain/Entities`
- [Customer rules](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/Customer.cs): `DyeHouseERP/src/DyeHouseERP.Domain/Entities/Customer.cs`
- [Delivery rules](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/Delivery.cs): `DyeHouseERP/src/DyeHouseERP.Domain/Entities/Delivery.cs`
- [Formation rules](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/FormationRequest.cs): `DyeHouseERP/src/DyeHouseERP.Domain/Entities/FormationRequest.cs`
- [Production rules](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/ProductionOrder.cs): `DyeHouseERP/src/DyeHouseERP.Domain/Entities/ProductionOrder.cs`
- [Material rules](https://github.com/beboatef/dyehouse-rep-/blob/main/DyeHouseERP/src/DyeHouseERP.Domain/Entities/Material.cs): `DyeHouseERP/src/DyeHouseERP.Domain/Entities/Material.cs`

### Other components

- **ERP user**

## Connections

- ERP user → Web client: uses
- Web client → HTTP API: requests
- HTTP API → Purchasing endpoints: hosts
- HTTP API → Inventory endpoints: hosts
- Purchasing endpoints → Purchasing: dispatches (evidence: `DyeHouseERP/src/DyeHouseERP.API/Controllers/PurchasesController.cs`)
- Inventory endpoints → Stock traceability: dispatches (evidence: `DyeHouseERP/src/DyeHouseERP.API/Controllers/InventoryTraceabilityController.cs`)
- Stock traceability → Application DB contract: queries (evidence: `DyeHouseERP/src/DyeHouseERP.Application/Inventory/Queries/GetStockTraceabilityQuery.cs`)
- Purchasing → Application DB contract: uses
- Dashboard summary → Application DB contract: queries (evidence: `DyeHouseERP/src/DyeHouseERP.Application/Dashboard/Queries/GetDashboardSummaryQuery.cs`)
- Approvals → Application DB contract: queries (evidence: `DyeHouseERP/src/DyeHouseERP.Application/Approvals/Queries/GetApprovalCenterQuery.cs`)
- Customers → Customer rules: uses
- Deliveries → Delivery rules: uses (evidence: `DyeHouseERP/src/DyeHouseERP.Application/Deliveries/Queries/GetDeliveryStatementQuery.cs`)
- Formation requests → Formation rules: uses (evidence: `DyeHouseERP/src/DyeHouseERP.Application/FormationRequests/Queries/GetFormationRequestsQuery.cs`)
- Production orders → Production rules: uses
- Materials → Material rules: uses
