# arivazhagan7b/erpnext architecture

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

- Interactive diagram: https://gitdiagram.com/arivazhagan7b/erpnext
- Repository: https://github.com/arivazhagan7b/erpnext

## Overview

ERPNext is an open-source ERP for operating business workflows. A representative transaction path starts with order and item handling, applies accounting and stock rules, and records financial and inventory effects; users also work directly with accounting, reporting, manufacturing, and projects. The banking frontend and ERPNext banking modules are visible in the tree, but their runtime connections were not sampled, so they are represented only as documented capability. Arrows use source-index references or README statements; unsampled internals are not inferred.

Main entry points: [`erpnext/controllers/accounts_controller.py`](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/accounts_controller.py) (Account transactions), [`erpnext/controllers/buying_controller.py`](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/buying_controller.py) (Buying transactions), [`erpnext/controllers/stock_controller.py`](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/stock_controller.py) (Stock transactions), [`erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py`](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py) (Serial batch bundles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orders["Order management"]
  node_buying["Buying transactions"]
  node_returns["Returns and credits"]
  node_item_details["Item details and pricing"]
end

subgraph group_accounting["Accounting"]
  node_accounts_controller["Account transactions"]
  node_party["Party accounts<br/>[party.py]"]
  node_dimensions["Accounting dimensions"]
  node_general_ledger[("General ledger<br/>[general_ledger.py]")]
  node_financial_reports["Financial statements"]
  node_report_engine["Custom report engine"]
end

subgraph group_stock["Inventory and stock"]
  node_stock_controller["Stock transactions"]
  node_stock_ledger[("Stock ledger<br/>[stock_ledger.py]")]
  node_valuation["Stock valuation<br/>[valuation.py]"]
  node_batches["Batch tracking<br/>[batch.py]"]
  node_serials["Serial tracking<br/>[serial_no.py]"]
  node_bundle_doctype["Serial batch bundles"]
  node_bundle_helpers["Bundle operations"]
end

subgraph group_operations["Production and projects"]
  node_manufacturing["Manufacturing<br/>[engine.py]"]
  node_projects["Project delivery"]
end

subgraph group_banking["Banking workflows"]
  node_bank_reconciliation["Bank reconciliation"]
  node_statement_import["Statement import"]
  node_banking_ui["Banking interface"]
end

node_user(("Business user"))

node_user -->|"manages orders"| node_buying
node_user -->|"records transactions"| node_accounts_controller
node_user -->|"tracks inventory"| node_stock_controller
node_user -->|"plans production"| node_manufacturing
node_user -->|"tracks projects"| node_projects
node_user -->|"reconciles accounts"| node_bank_reconciliation
node_buying -->|"extends"| node_accounts_controller
node_buying -->|"uses item details"| node_item_details
node_buying -->|"uses stock rules"| node_stock_controller
node_accounts_controller -->|"validates due dates"| node_party
node_accounts_controller -->|"uses dimensions"| node_dimensions
node_accounts_controller -->|"posts ledger"| node_general_ledger
node_accounts_controller -->|"handles returns"| node_returns
node_accounts_controller -->|"uses item details"| node_item_details
node_report_engine -->|"filters dimensions"| node_dimensions
node_report_engine -->|"uses statements"| node_financial_reports
node_stock_controller -->|"validates serials"| node_serials
node_stock_controller -->|"uses bundles"| node_bundle_doctype
node_bundle_helpers -->|"creates bundles"| node_bundle_doctype
node_batches -->|"uses bundles"| node_bundle_doctype
node_banking_ui -.->|"supports reconciliation"| node_bank_reconciliation
node_banking_ui -.->|"supports imports"| node_statement_import

click node_buying "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/buying_controller.py"
click node_accounts_controller "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/accounts_controller.py"
click node_returns "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/sales_and_purchase_return.py"
click node_party "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/party.py"
click node_dimensions "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py"
click node_general_ledger "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/general_ledger.py"
click node_financial_reports "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/report/financial_statements.py"
click node_report_engine "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/financial_report_template/financial_report_engine.py"
click node_item_details "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/get_item_details.py"
click node_stock_controller "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/stock_controller.py"
click node_stock_ledger "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/stock_ledger.py"
click node_valuation "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/valuation.py"
click node_batches "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/doctype/batch/batch.py"
click node_serials "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/doctype/serial_no/serial_no.py"
click node_bundle_doctype "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py"
click node_bundle_helpers "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/serial_batch_bundle.py"
click node_manufacturing "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/manufacturing/scheduling/engine.py"
click node_projects "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py"
click node_bank_reconciliation "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py"
click node_statement_import "https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py"
click node_banking_ui "https://github.com/arivazhagan7b/erpnext/blob/develop/banking/src/pages/BankReconciliation.tsx"

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_buying,node_returns,node_item_details,node_user toneBlue
class node_accounts_controller,node_party,node_dimensions,node_general_ledger,node_financial_reports,node_report_engine toneAmber
class node_stock_controller,node_stock_ledger,node_valuation,node_batches,node_serials,node_bundle_doctype,node_bundle_helpers toneMint
class node_manufacturing,node_projects toneRose
class node_bank_reconciliation,node_statement_import,node_banking_ui toneIndigo
```

## Components

### Order management

- [Buying transactions](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/buying_controller.py): `erpnext/controllers/buying_controller.py`
- [Returns and credits](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/sales_and_purchase_return.py): `erpnext/controllers/sales_and_purchase_return.py`
- [Item details and pricing](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/get_item_details.py): `erpnext/stock/get_item_details.py`

### Accounting

- [Account transactions](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/accounts_controller.py): `erpnext/controllers/accounts_controller.py`
- [Party accounts](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/party.py): `erpnext/accounts/party.py`
- [Accounting dimensions](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py): `erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py`
- [General ledger](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/general_ledger.py): `erpnext/accounts/general_ledger.py`
- [Financial statements](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/report/financial_statements.py): `erpnext/accounts/report/financial_statements.py`
- [Custom report engine](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/financial_report_template/financial_report_engine.py): `erpnext/accounts/doctype/financial_report_template/financial_report_engine.py`

### Inventory and stock

- [Stock transactions](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/controllers/stock_controller.py): `erpnext/controllers/stock_controller.py`
- [Stock ledger](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/stock_ledger.py): `erpnext/stock/stock_ledger.py`
- [Stock valuation](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/valuation.py): `erpnext/stock/valuation.py`
- [Batch tracking](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/doctype/batch/batch.py): `erpnext/stock/doctype/batch/batch.py`
- [Serial tracking](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/doctype/serial_no/serial_no.py): `erpnext/stock/doctype/serial_no/serial_no.py`
- [Serial batch bundles](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py): `erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py`
- [Bundle operations](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/stock/serial_batch_bundle.py): `erpnext/stock/serial_batch_bundle.py`

### Production and projects

- [Manufacturing](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/manufacturing/scheduling/engine.py): `erpnext/manufacturing/scheduling/engine.py`
- [Project delivery](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py): `erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py`

### Banking workflows

- [Bank reconciliation](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py): `erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py`
- [Statement import](https://github.com/arivazhagan7b/erpnext/blob/develop/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py): `erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py`
- [Banking interface](https://github.com/arivazhagan7b/erpnext/blob/develop/banking/src/pages/BankReconciliation.tsx): `banking/src/pages/BankReconciliation.tsx`

### Other components

- **Business user**

## Connections

- Business user → Buying transactions: manages orders (evidence: `README.md`)
- Business user → Account transactions: records transactions (evidence: `README.md`)
- Business user → Stock transactions: tracks inventory (evidence: `README.md`)
- Business user → Manufacturing: plans production (evidence: `README.md`)
- Business user → Project delivery: tracks projects (evidence: `README.md`)
- Business user → Bank reconciliation: reconciles accounts (evidence: `README.md`)
- Buying transactions → Account transactions: extends (evidence: `erpnext/controllers/buying_controller.py`)
- Buying transactions → Item details and pricing: uses item details (evidence: `erpnext/controllers/buying_controller.py`)
- Buying transactions → Stock transactions: uses stock rules (evidence: `erpnext/controllers/buying_controller.py`)
- Account transactions → Party accounts: validates due dates (evidence: `erpnext/controllers/accounts_controller.py`)
- Account transactions → Accounting dimensions: uses dimensions (evidence: `erpnext/controllers/accounts_controller.py`)
- Account transactions → General ledger: posts ledger (evidence: `erpnext/controllers/accounts_controller.py`)
- Account transactions → Returns and credits: handles returns (evidence: `erpnext/controllers/accounts_controller.py`)
- Account transactions → Item details and pricing: uses item details (evidence: `erpnext/controllers/accounts_controller.py`)
- Custom report engine → Accounting dimensions: filters dimensions (evidence: `erpnext/accounts/doctype/financial_report_template/financial_report_engine.py`)
- Custom report engine → Financial statements: uses statements (evidence: `erpnext/accounts/doctype/financial_report_template/financial_report_engine.py`)
- Stock transactions → Serial tracking: validates serials (evidence: `erpnext/stock/doctype/serial_no/serial_no.py`)
- Stock transactions → Serial batch bundles: uses bundles (evidence: `erpnext/stock/services/serial_batch_bundle_service.py`)
- Bundle operations → Serial batch bundles: creates bundles (evidence: `erpnext/stock/serial_batch_bundle.py`)
- Batch tracking → Serial batch bundles: uses bundles (evidence: `erpnext/stock/doctype/batch/batch.py`)
- Banking interface → Bank reconciliation: supports reconciliation
- Banking interface → Statement import: supports imports
