# rahul270903/bizflow architecture

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

- Interactive diagram: https://gitdiagram.com/rahul270903/bizflow
- Repository: https://github.com/rahul270903/bizflow

## Overview

BizFlow is a modular CRM/ERP platform: users work through a React SPA, whose API client calls Django services for CRM, inventory, procurement, sales fulfillment, billing, identity, and executive metrics. The documented business stages span lead conversion, purchasing and goods receipt, order reservation and shipment, then invoicing and payment. Sampled service code confirms CRM conversion, inventory adjustment, sales reservation/dispatch, and invoice settlement; other subsystem links are included only where the README or API paths document them.

Main entry points: [`frontend/src/api/client.js`](https://github.com/rahul270903/bizflow/blob/main/frontend/src/api/client.js) (API client), [`backend/apps/sales/services.py`](https://github.com/rahul270903/bizflow/blob/main/backend/apps/sales/services.py) (Order and shipment), [`backend/apps/billing/services.py`](https://github.com/rahul270903/bizflow/blob/main/backend/apps/billing/services.py) (Invoice settlement), [`backend/apps/inventory/models.py`](https://github.com/rahul270903/bizflow/blob/main/backend/apps/inventory/models.py) (Catalog and ledger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React workspace"]
  node_workspace["BizFlow workspace<br/>[App.jsx]"]
  node_api["API client<br/>[client.js]"]
  node_login["Login and session<br/>[AuthContext.jsx]"]
  node_dashboard["Executive dashboard<br/>[DashboardPage.jsx]"]
  node_settings["User settings<br/>[SettingsPage.jsx]"]
  node_crmui["CRM workspace<br/>[CRMPage.jsx]"]
  node_inventoryui["Inventory workspace<br/>[InventoryPage.jsx]"]
  node_purchasingui["Purchasing workspace<br/>[PurchasingPage.jsx]"]
  node_salesui["Sales workspace<br/>[SalesPage.jsx]"]
  node_billingui["Billing workspace<br/>[BillingPage.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Identity and RBAC"]
  node_metrics["Business metrics<br/>[views.py]"]
end

subgraph group_crm["CRM pipeline"]
  node_crmapi["CRM endpoints<br/>[views.py]"]
  node_lead["Lead conversion<br/>[services.py]"]
  node_crmdata[("CRM records<br/>[models.py]")]
end

subgraph group_supply["Supply and inventory"]
  node_inventoryapi["Inventory endpoints<br/>[views.py]"]
  node_stock["Stock adjustment<br/>[services.py]"]
  node_inventorydata[("Catalog and ledger<br/>[models.py]")]
  node_purchasing["Purchase and receipt"]
end

subgraph group_commerce["Sales and finance"]
  node_sales["Order and shipment<br/>[services.py]"]
  node_salesdata[("Sales records<br/>[models.py]")]
  node_billing["Invoice settlement<br/>[services.py]"]
  node_billingdata[("Invoices and payments<br/>[models.py]")]
end

node_user(("Business user"))

node_user -->|"uses"| node_workspace
node_workspace -.->|"requests data"| node_api
node_login -->|"authenticates via"| node_api
node_crmui -.->|"requests CRM"| node_api
node_inventoryui -.->|"requests stock"| node_api
node_purchasingui -.->|"requests purchasing"| node_api
node_salesui -.->|"requests orders"| node_api
node_billingui -.->|"requests billing"| node_api
node_dashboard -.->|"requests metrics"| node_api
node_settings -.->|"requests settings"| node_api
node_api -->|"calls auth routes"| node_auth
node_api -->|"calls CRM routes"| node_crmapi
node_api -->|"calls inventory routes"| node_inventoryapi
node_api -->|"calls purchasing routes"| node_purchasing
node_api -->|"calls sales routes"| node_sales
node_api -->|"calls billing routes"| node_billing
node_api -->|"calls dashboard route"| node_metrics
node_lead -->|"creates records"| node_crmdata
node_stock -->|"updates and records"| node_inventorydata
node_sales -->|"updates orders"| node_salesdata
node_sales -->|"reserves and dispatches"| node_inventorydata
node_billing -->|"records settlement"| node_billingdata
node_billing -->|"reads order"| node_salesdata
node_purchasing -->|"receipts increase stock"| node_inventorydata
node_sales -.->|"invoice workflow"| node_billing

click node_workspace "https://github.com/rahul270903/bizflow/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/rahul270903/bizflow/blob/main/frontend/src/api/client.js"
click node_login "https://github.com/rahul270903/bizflow/blob/main/frontend/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_settings "https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/SettingsPage.jsx"
click node_auth "https://github.com/rahul270903/bizflow/tree/main/backend/apps/accounts"
click node_crmui "https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/CRMPage.jsx"
click node_crmapi "https://github.com/rahul270903/bizflow/blob/main/backend/apps/crm/views.py"
click node_lead "https://github.com/rahul270903/bizflow/blob/main/backend/apps/crm/services.py"
click node_crmdata "https://github.com/rahul270903/bizflow/blob/main/backend/apps/crm/models.py"
click node_inventoryui "https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/InventoryPage.jsx"
click node_inventoryapi "https://github.com/rahul270903/bizflow/blob/main/backend/apps/inventory/views.py"
click node_stock "https://github.com/rahul270903/bizflow/blob/main/backend/apps/inventory/services.py"
click node_inventorydata "https://github.com/rahul270903/bizflow/blob/main/backend/apps/inventory/models.py"
click node_purchasingui "https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/PurchasingPage.jsx"
click node_purchasing "https://github.com/rahul270903/bizflow/tree/main/backend/apps/purchasing"
click node_salesui "https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/SalesPage.jsx"
click node_sales "https://github.com/rahul270903/bizflow/blob/main/backend/apps/sales/services.py"
click node_salesdata "https://github.com/rahul270903/bizflow/blob/main/backend/apps/sales/models.py"
click node_billingui "https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/BillingPage.jsx"
click node_billing "https://github.com/rahul270903/bizflow/blob/main/backend/apps/billing/services.py"
click node_billingdata "https://github.com/rahul270903/bizflow/blob/main/backend/apps/billing/models.py"
click node_metrics "https://github.com/rahul270903/bizflow/blob/main/backend/apps/common/views.py"

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_workspace,node_api,node_login,node_dashboard,node_settings,node_crmui,node_inventoryui,node_purchasingui,node_salesui,node_billingui,node_user toneBlue
class node_auth,node_metrics toneAmber
class node_crmapi,node_lead,node_crmdata toneMint
class node_inventoryapi,node_stock,node_inventorydata,node_purchasing toneRose
class node_sales,node_salesdata,node_billing,node_billingdata toneIndigo
```

## Components

### React workspace

- [BizFlow workspace](https://github.com/rahul270903/bizflow/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/rahul270903/bizflow/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Login and session](https://github.com/rahul270903/bizflow/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Executive dashboard](https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [User settings](https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/SettingsPage.jsx): `frontend/src/pages/SettingsPage.jsx`
- [CRM workspace](https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/CRMPage.jsx): `frontend/src/pages/CRMPage.jsx`
- [Inventory workspace](https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/InventoryPage.jsx): `frontend/src/pages/InventoryPage.jsx`
- [Purchasing workspace](https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/PurchasingPage.jsx): `frontend/src/pages/PurchasingPage.jsx`
- [Sales workspace](https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/SalesPage.jsx): `frontend/src/pages/SalesPage.jsx`
- [Billing workspace](https://github.com/rahul270903/bizflow/blob/main/frontend/src/pages/BillingPage.jsx): `frontend/src/pages/BillingPage.jsx`

### Identity and access

- [Identity and RBAC](https://github.com/rahul270903/bizflow/tree/main/backend/apps/accounts): `backend/apps/accounts`
- [Business metrics](https://github.com/rahul270903/bizflow/blob/main/backend/apps/common/views.py): `backend/apps/common/views.py`

### CRM pipeline

- [CRM endpoints](https://github.com/rahul270903/bizflow/blob/main/backend/apps/crm/views.py): `backend/apps/crm/views.py`
- [Lead conversion](https://github.com/rahul270903/bizflow/blob/main/backend/apps/crm/services.py): `backend/apps/crm/services.py`
- [CRM records](https://github.com/rahul270903/bizflow/blob/main/backend/apps/crm/models.py): `backend/apps/crm/models.py`

### Supply and inventory

- [Inventory endpoints](https://github.com/rahul270903/bizflow/blob/main/backend/apps/inventory/views.py): `backend/apps/inventory/views.py`
- [Stock adjustment](https://github.com/rahul270903/bizflow/blob/main/backend/apps/inventory/services.py): `backend/apps/inventory/services.py`
- [Catalog and ledger](https://github.com/rahul270903/bizflow/blob/main/backend/apps/inventory/models.py): `backend/apps/inventory/models.py`
- [Purchase and receipt](https://github.com/rahul270903/bizflow/tree/main/backend/apps/purchasing): `backend/apps/purchasing`

### Sales and finance

- [Order and shipment](https://github.com/rahul270903/bizflow/blob/main/backend/apps/sales/services.py): `backend/apps/sales/services.py`
- [Sales records](https://github.com/rahul270903/bizflow/blob/main/backend/apps/sales/models.py): `backend/apps/sales/models.py`
- [Invoice settlement](https://github.com/rahul270903/bizflow/blob/main/backend/apps/billing/services.py): `backend/apps/billing/services.py`
- [Invoices and payments](https://github.com/rahul270903/bizflow/blob/main/backend/apps/billing/models.py): `backend/apps/billing/models.py`

### Other components

- **Business user**

## Connections

- Business user → BizFlow workspace: uses
- BizFlow workspace → API client: requests data
- Login and session → API client: authenticates via (evidence: `frontend/src/context/AuthContext.jsx`)
- CRM workspace → API client: requests CRM
- Inventory workspace → API client: requests stock
- Purchasing workspace → API client: requests purchasing
- Sales workspace → API client: requests orders
- Billing workspace → API client: requests billing
- Executive dashboard → API client: requests metrics
- User settings → API client: requests settings
- API client → Identity and RBAC: calls auth routes (evidence: `frontend/src/api/client.js`)
- API client → CRM endpoints: calls CRM routes (evidence: `frontend/src/api/client.js`)
- API client → Inventory endpoints: calls inventory routes (evidence: `frontend/src/api/client.js`)
- API client → Purchase and receipt: calls purchasing routes (evidence: `frontend/src/api/client.js`)
- API client → Order and shipment: calls sales routes (evidence: `frontend/src/api/client.js`)
- API client → Invoice settlement: calls billing routes (evidence: `frontend/src/api/client.js`)
- API client → Business metrics: calls dashboard route (evidence: `frontend/src/api/client.js`)
- Lead conversion → CRM records: creates records (evidence: `backend/apps/crm/services.py`)
- Stock adjustment → Catalog and ledger: updates and records (evidence: `backend/apps/inventory/services.py`)
- Order and shipment → Sales records: updates orders (evidence: `backend/apps/sales/services.py`)
- Order and shipment → Catalog and ledger: reserves and dispatches (evidence: `backend/apps/sales/services.py`)
- Invoice settlement → Invoices and payments: records settlement (evidence: `backend/apps/billing/services.py`)
- Invoice settlement → Sales records: reads order (evidence: `backend/apps/billing/services.py`)
- Purchase and receipt → Catalog and ledger: receipts increase stock
- Order and shipment → Invoice settlement: invoice workflow
