# edgyulnazaryandev/erp_system_full architecture

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

- Interactive diagram: https://gitdiagram.com/edgyulnazaryandev/erp_system_full
- Repository: https://github.com/edgyulnazaryandev/erp_system_full

## Overview

ERP_SYSTEM is a multi-tenant ERP backend exposing business operations through NestJS APIs. A representative user workflow is managing customer and supplier activity, creating and approving purchasing records, then handling accounting and financial insight. Other product areas include HR, projects, manufacturing, inventory, logistics, service management, reporting, communications, and workflow automation. The sampled controllers explicitly delegate to their services; the tree indicates other product areas, but their wiring is not established by the excerpts.

Main entry points: [`backend/src/modules/accounting/accounting.controller.ts`](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/accounting/accounting.controller.ts) (Accounting API), [`backend/src/modules/crm/crm.controller.ts`](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/crm/crm.controller.ts) (CRM API), [`backend/src/modules/procurement/procurement.controller.ts`](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/procurement/procurement.controller.ts) (Procurement API), [`backend/src/brains/orchestrator/orchestrator.service.ts`](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/brains/orchestrator/orchestrator.service.ts) (Strategy Orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Tenancy"]
  node_auth["Authentication<br/>[auth.controller.ts]"]
  node_tenants["Tenant Context<br/>[tenant.service.ts]"]
end

subgraph group_commercial["Commercial Operations"]
  node_crm["CRM API<br/>[crm.controller.ts]"]
  node_crmservice["CRM Services<br/>[crm.service.ts]"]
  node_procurement["Procurement API"]
  node_procurementservice["Procurement Services"]
  node_inventory["Inventory"]
  node_transport["Shipping"]
end

subgraph group_finance["Finance and Intelligence"]
  node_accounting["Accounting API"]
  node_accountingservice["Accounting Services"]
  node_rules["Financial Rules"]
  node_brains["Strategy Orchestrator"]
end

subgraph group_delivery["People and Delivery"]
  node_hr["Human Resources"]
  node_projects["Project Management"]
  node_manufacturing["Manufacturing"]
  node_service["Service Management"]
end

subgraph group_platform["ERP Platform"]
  node_reporting["BI Reporting"]
  node_workflow["Workflow Automation"]
  node_communication["Communication"]
  node_kafka["Event Messaging"]
  node_database["Database Configuration<br/>[database.module.ts]"]
end

node_user(("ERP User"))

node_user -->|"signs in"| node_auth
node_user -->|"manages customers"| node_crm
node_user -->|"manages purchasing"| node_procurement
node_user -->|"manages finances"| node_accounting
node_crm -->|"delegates"| node_crmservice
node_procurement -->|"delegates"| node_procurementservice
node_accounting -->|"delegates"| node_accountingservice
node_accounting -->|"runs rules"| node_rules
node_brains -.->|"receives events"| node_kafka

click node_auth "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/auth/controllers/auth.controller.ts"
click node_tenants "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/tenants/tenant.service.ts"
click node_crm "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/crm/crm.controller.ts"
click node_crmservice "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/crm/crm.service.ts"
click node_procurement "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/procurement/procurement.controller.ts"
click node_procurementservice "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/procurement/procurement.service.ts"
click node_inventory "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/inventory"
click node_transport "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/transportation"
click node_accounting "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/accounting/accounting.controller.ts"
click node_accountingservice "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/accounting/accounting.service.ts"
click node_rules "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/accounting/services/rule-engine.service.ts"
click node_brains "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/brains/orchestrator/orchestrator.service.ts"
click node_hr "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/hr"
click node_projects "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/project-management"
click node_manufacturing "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/manufacturing"
click node_service "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/service-management/service-management.controller.ts"
click node_reporting "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/bi-reporting"
click node_workflow "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/workflow-automation"
click node_communication "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/communication"
click node_kafka "https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/infrastructure/kafka"
click node_database "https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/core/database/database.module.ts"

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_auth,node_tenants,node_user toneBlue
class node_crm,node_crmservice,node_procurement,node_procurementservice,node_inventory,node_transport toneAmber
class node_accounting,node_accountingservice,node_rules,node_brains toneMint
class node_hr,node_projects,node_manufacturing,node_service toneRose
class node_reporting,node_workflow,node_communication,node_kafka,node_database toneIndigo
```

## Components

### Access and Tenancy

- [Authentication](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/auth/controllers/auth.controller.ts): `backend/src/modules/auth/controllers/auth.controller.ts`
- [Tenant Context](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/tenants/tenant.service.ts): `backend/src/modules/tenants/tenant.service.ts`

### Commercial Operations

- [CRM API](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/crm/crm.controller.ts): `backend/src/modules/crm/crm.controller.ts`
- [CRM Services](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/crm/crm.service.ts): `backend/src/modules/crm/crm.service.ts`
- [Procurement API](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/procurement/procurement.controller.ts): `backend/src/modules/procurement/procurement.controller.ts`
- [Procurement Services](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/procurement/procurement.service.ts): `backend/src/modules/procurement/procurement.service.ts`
- [Inventory](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/inventory): `backend/src/modules/inventory`
- [Shipping](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/transportation): `backend/src/modules/transportation`

### Finance and Intelligence

- [Accounting API](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/accounting/accounting.controller.ts): `backend/src/modules/accounting/accounting.controller.ts`
- [Accounting Services](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/accounting/accounting.service.ts): `backend/src/modules/accounting/accounting.service.ts`
- [Financial Rules](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/accounting/services/rule-engine.service.ts): `backend/src/modules/accounting/services/rule-engine.service.ts`
- [Strategy Orchestrator](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/brains/orchestrator/orchestrator.service.ts): `backend/src/brains/orchestrator/orchestrator.service.ts`

### People and Delivery

- [Human Resources](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/hr): `backend/src/modules/hr`
- [Project Management](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/project-management): `backend/src/modules/project-management`
- [Manufacturing](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/manufacturing): `backend/src/modules/manufacturing`
- [Service Management](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/modules/service-management/service-management.controller.ts): `backend/src/modules/service-management/service-management.controller.ts`

### ERP Platform

- [BI Reporting](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/bi-reporting): `backend/src/modules/bi-reporting`
- [Workflow Automation](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/workflow-automation): `backend/src/modules/workflow-automation`
- [Communication](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/modules/communication): `backend/src/modules/communication`
- [Event Messaging](https://github.com/edgyulnazaryandev/erp_system_full/tree/main/backend/src/infrastructure/kafka): `backend/src/infrastructure/kafka`
- [Database Configuration](https://github.com/edgyulnazaryandev/erp_system_full/blob/main/backend/src/core/database/database.module.ts): `backend/src/core/database/database.module.ts`

### Other components

- **ERP User**

## Connections

- ERP User → Authentication: signs in
- ERP User → CRM API: manages customers
- ERP User → Procurement API: manages purchasing
- ERP User → Accounting API: manages finances
- CRM API → CRM Services: delegates
- Procurement API → Procurement Services: delegates
- Accounting API → Accounting Services: delegates
- Accounting API → Financial Rules: runs rules
- Strategy Orchestrator → Event Messaging: receives events
