# taruntron/alter-erp-system architecture

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

- Interactive diagram: https://gitdiagram.com/taruntron/alter-erp-system
- Repository: https://github.com/taruntron/alter-erp-system

## Overview

This is a browser-based retail and wholesale business-management application. Users sign in, select a business view, and work through sales, purchasing, inventory, accounting, and reporting; the shared store context supplies application data and persists operational changes through Firebase. The graph preserves the major domain views and administration capabilities visible in the source index. Some view implementations were not excerpted, so their internal behavior and links beyond indexed imports are not asserted.

Main entry points: [`src/App.tsx`](https://github.com/taruntron/alter-erp-system/blob/main/src/App.tsx) (Application router), [`src/context/StoreContext.tsx`](https://github.com/taruntron/alter-erp-system/blob/main/src/context/StoreContext.tsx) (Shared business store), [`src/components/Dashboard/DashboardView.tsx`](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Dashboard/DashboardView.tsx) (Dashboard), [`src/components/POS/PosView.tsx`](https://github.com/taruntron/alter-erp-system/blob/main/src/components/POS/PosView.tsx) (Point of sale)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Application router<br/>[App.tsx]"]
  node_header["Header controls<br/>[Header.tsx]"]
  node_sidebar["Navigation sidebar<br/>[Sidebar.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_login["Login views<br/>[LoginPanel.tsx]"]
end

subgraph group_commerce["Sales and purchasing"]
  node_pos["Point of sale<br/>[PosView.tsx]"]
  node_invoiceprint["Invoice printing"]
  node_invoices["Invoice history"]
  node_salesreturns["Sales returns"]
  node_quotations["Quotations<br/>[QuotationView.tsx]"]
  node_purchases["Purchase entry<br/>[PurchaseView.tsx]"]
  node_purchaseorders["Purchase orders"]
  node_purchasereturns["Purchase returns"]
end

subgraph group_operations["Inventory and finance"]
  node_itemmaster["Item master<br/>[ItemMasterView.tsx]"]
  node_stock["Current stock"]
  node_inventorymasters["Inventory masters"]
  node_partymaster["Party master"]
  node_transfers["Stock transfers"]
  node_accounting["Accounting"]
  node_reports["Reports and analytics"]
  node_vouchers["Vouchers<br/>[VoucherView.tsx]"]
  node_admin["Master control"]
end

subgraph group_platform["Shared platform"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_store["Shared business store<br/>[StoreContext.tsx]"]
  node_firebase["Firebase client<br/>[firebase.ts]"]
  node_printsettings["Print settings<br/>[printSettings.ts]"]
end

node_user(("Business user"))
node_firestore[("Cloud Firestore")]

node_user -->|"uses"| node_app
node_app -->|"checks session"| node_auth
node_app -->|"renders"| node_header
node_app -->|"renders"| node_sidebar
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_pos
node_app -->|"routes to"| node_invoices
node_app -->|"routes to"| node_purchases
node_app -->|"routes to"| node_inventorymasters
node_app -->|"routes to"| node_accounting
node_app -.->|"routes to"| node_salesreturns
node_app -.->|"routes to"| node_quotations
node_app -.->|"routes to"| node_purchaseorders
node_app -.->|"routes to"| node_purchasereturns
node_app -.->|"routes to"| node_stock
node_app -.->|"routes to"| node_transfers
node_app -.->|"routes to"| node_reports
node_app -.->|"routes to"| node_vouchers
node_app -.->|"routes to"| node_admin
node_app -.->|"renders"| node_login
node_pos -->|"uses"| node_invoiceprint
node_invoices -->|"uses"| node_invoiceprint
node_quotations -->|"reads settings"| node_printsettings
node_purchases -->|"uses data"| node_store
node_pos -->|"uses data"| node_store
node_invoices -->|"uses data"| node_store
node_salesreturns -->|"uses data"| node_store
node_purchaseorders -->|"uses data"| node_store
node_purchasereturns -->|"uses data"| node_store
node_itemmaster -->|"uses data"| node_store
node_inventorymasters -->|"uses data"| node_store
node_partymaster -->|"uses data"| node_store
node_transfers -->|"uses data"| node_store
node_accounting -->|"uses data"| node_store
node_reports -->|"uses data"| node_store
node_vouchers -->|"uses data"| node_store
node_admin -->|"uses data"| node_store
node_store -->|"uses client"| node_firebase
node_auth -->|"uses client"| node_firebase
node_firebase -->|"connects to"| node_firestore
node_dashboard -->|"uses data"| node_store
node_dashboard -->|"navigates via"| node_sidebar

click node_app "https://github.com/taruntron/alter-erp-system/blob/main/src/App.tsx"
click node_header "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Header.tsx"
click node_sidebar "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Navigation/Sidebar.tsx"
click node_dashboard "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Dashboard/DashboardView.tsx"
click node_login "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Auth/LoginPanel.tsx"
click node_pos "https://github.com/taruntron/alter-erp-system/blob/main/src/components/POS/PosView.tsx"
click node_invoiceprint "https://github.com/taruntron/alter-erp-system/blob/main/src/components/POS/InvoicePrintModal.tsx"
click node_invoices "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Invoices/InvoiceListView.tsx"
click node_salesreturns "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Sales/SalesReturnView.tsx"
click node_quotations "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Quotations/QuotationView.tsx"
click node_purchases "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Purchase/PurchaseView.tsx"
click node_purchaseorders "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Purchase/PurchaseOrderView.tsx"
click node_purchasereturns "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Purchase/PurchaseReturnView.tsx"
click node_itemmaster "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Inventory/ItemMasterView.tsx"
click node_stock "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Inventory/CurrentStockView.tsx"
click node_inventorymasters "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Masters/InventoryMastersView.tsx"
click node_partymaster "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Masters/PartyMasterView.tsx"
click node_transfers "https://github.com/taruntron/alter-erp-system/blob/main/src/components/StockTransfer/StockTransferView.tsx"
click node_accounting "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Accounting/AccountingDashboard.tsx"
click node_reports "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Reports/ReportsAnalyticsView.tsx"
click node_vouchers "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Vouchers/VoucherView.tsx"
click node_admin "https://github.com/taruntron/alter-erp-system/blob/main/src/components/Admin/MasterControlView.tsx"
click node_auth "https://github.com/taruntron/alter-erp-system/blob/main/src/context/AuthContext.tsx"
click node_store "https://github.com/taruntron/alter-erp-system/blob/main/src/context/StoreContext.tsx"
click node_firebase "https://github.com/taruntron/alter-erp-system/blob/main/src/lib/firebase.ts"
click node_printsettings "https://github.com/taruntron/alter-erp-system/blob/main/src/utils/printSettings.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_app,node_header,node_sidebar,node_dashboard,node_login,node_user toneBlue
class node_pos,node_invoiceprint,node_invoices,node_salesreturns,node_quotations,node_purchases,node_purchaseorders,node_purchasereturns,node_firestore toneAmber
class node_itemmaster,node_stock,node_inventorymasters,node_partymaster,node_transfers,node_accounting,node_reports,node_vouchers,node_admin toneMint
class node_auth,node_store,node_firebase,node_printsettings toneRose
```

## Components

### Application shell

- [Application router](https://github.com/taruntron/alter-erp-system/blob/main/src/App.tsx): `src/App.tsx`
- [Header controls](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Navigation sidebar](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Navigation/Sidebar.tsx): `src/components/Navigation/Sidebar.tsx`
- [Dashboard](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Dashboard/DashboardView.tsx): `src/components/Dashboard/DashboardView.tsx`
- [Login views](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Auth/LoginPanel.tsx): `src/components/Auth/LoginPanel.tsx`

### Sales and purchasing

- [Point of sale](https://github.com/taruntron/alter-erp-system/blob/main/src/components/POS/PosView.tsx): `src/components/POS/PosView.tsx`
- [Invoice printing](https://github.com/taruntron/alter-erp-system/blob/main/src/components/POS/InvoicePrintModal.tsx): `src/components/POS/InvoicePrintModal.tsx`
- [Invoice history](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Invoices/InvoiceListView.tsx): `src/components/Invoices/InvoiceListView.tsx`
- [Sales returns](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Sales/SalesReturnView.tsx): `src/components/Sales/SalesReturnView.tsx`
- [Quotations](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Quotations/QuotationView.tsx): `src/components/Quotations/QuotationView.tsx`
- [Purchase entry](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Purchase/PurchaseView.tsx): `src/components/Purchase/PurchaseView.tsx`
- [Purchase orders](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Purchase/PurchaseOrderView.tsx): `src/components/Purchase/PurchaseOrderView.tsx`
- [Purchase returns](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Purchase/PurchaseReturnView.tsx): `src/components/Purchase/PurchaseReturnView.tsx`

### Inventory and finance

- [Item master](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Inventory/ItemMasterView.tsx): `src/components/Inventory/ItemMasterView.tsx`
- [Current stock](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Inventory/CurrentStockView.tsx): `src/components/Inventory/CurrentStockView.tsx`
- [Inventory masters](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Masters/InventoryMastersView.tsx): `src/components/Masters/InventoryMastersView.tsx`
- [Party master](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Masters/PartyMasterView.tsx): `src/components/Masters/PartyMasterView.tsx`
- [Stock transfers](https://github.com/taruntron/alter-erp-system/blob/main/src/components/StockTransfer/StockTransferView.tsx): `src/components/StockTransfer/StockTransferView.tsx`
- [Accounting](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Accounting/AccountingDashboard.tsx): `src/components/Accounting/AccountingDashboard.tsx`
- [Reports and analytics](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Reports/ReportsAnalyticsView.tsx): `src/components/Reports/ReportsAnalyticsView.tsx`
- [Vouchers](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Vouchers/VoucherView.tsx): `src/components/Vouchers/VoucherView.tsx`
- [Master control](https://github.com/taruntron/alter-erp-system/blob/main/src/components/Admin/MasterControlView.tsx): `src/components/Admin/MasterControlView.tsx`

### Shared platform

- [Authentication state](https://github.com/taruntron/alter-erp-system/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Shared business store](https://github.com/taruntron/alter-erp-system/blob/main/src/context/StoreContext.tsx): `src/context/StoreContext.tsx`
- [Firebase client](https://github.com/taruntron/alter-erp-system/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- [Print settings](https://github.com/taruntron/alter-erp-system/blob/main/src/utils/printSettings.ts): `src/utils/printSettings.ts`

### Other components

- **Business user**
- **Cloud Firestore**

## Connections

- Business user → Application router: uses (evidence: `src/App.tsx`)
- Application router → Authentication state: checks session (evidence: `src/App.tsx`)
- Application router → Header controls: renders (evidence: `src/App.tsx`)
- Application router → Navigation sidebar: renders (evidence: `src/App.tsx`)
- Application router → Dashboard: routes to (evidence: `src/App.tsx`)
- Application router → Point of sale: routes to (evidence: `src/App.tsx`)
- Application router → Invoice history: routes to (evidence: `src/App.tsx`)
- Application router → Purchase entry: routes to (evidence: `src/App.tsx`)
- Application router → Inventory masters: routes to (evidence: `src/App.tsx`)
- Application router → Accounting: routes to (evidence: `src/App.tsx`)
- Application router → Sales returns: routes to (evidence: `src/App.tsx`)
- Application router → Quotations: routes to (evidence: `src/App.tsx`)
- Application router → Purchase orders: routes to (evidence: `src/App.tsx`)
- Application router → Purchase returns: routes to (evidence: `src/App.tsx`)
- Application router → Current stock: routes to (evidence: `src/App.tsx`)
- Application router → Stock transfers: routes to (evidence: `src/App.tsx`)
- Application router → Reports and analytics: routes to (evidence: `src/App.tsx`)
- Application router → Vouchers: routes to (evidence: `src/App.tsx`)
- Application router → Master control: routes to (evidence: `src/App.tsx`)
- Application router → Login views: renders (evidence: `src/App.tsx`)
- Point of sale → Invoice printing: uses (evidence: `src/components/POS/PosView.tsx`)
- Invoice history → Invoice printing: uses (evidence: `src/components/Invoices/InvoiceListView.tsx`)
- Quotations → Print settings: reads settings (evidence: `src/components/Quotations/QuotationView.tsx`)
- Purchase entry → Shared business store: uses data (evidence: `src/components/Purchase/PurchaseView.tsx`)
- Point of sale → Shared business store: uses data (evidence: `src/components/POS/PosView.tsx`)
- Invoice history → Shared business store: uses data (evidence: `src/components/Invoices/InvoiceListView.tsx`)
- Sales returns → Shared business store: uses data (evidence: `src/components/Sales/SalesReturnView.tsx`)
- Purchase orders → Shared business store: uses data (evidence: `src/components/Purchase/PurchaseOrderView.tsx`)
- Purchase returns → Shared business store: uses data (evidence: `src/components/Purchase/PurchaseReturnView.tsx`)
- Item master → Shared business store: uses data (evidence: `src/components/Inventory/ItemMasterView.tsx`)
- Inventory masters → Shared business store: uses data (evidence: `src/components/Masters/InventoryMastersView.tsx`)
- Party master → Shared business store: uses data (evidence: `src/components/Masters/PartyMasterView.tsx`)
- Stock transfers → Shared business store: uses data (evidence: `src/components/StockTransfer/StockTransferView.tsx`)
- Accounting → Shared business store: uses data (evidence: `src/components/Accounting/AccountingDashboard.tsx`)
- Reports and analytics → Shared business store: uses data
- Vouchers → Shared business store: uses data (evidence: `src/components/Vouchers/VoucherView.tsx`)
- Master control → Shared business store: uses data (evidence: `src/components/Admin/MasterControlView.tsx`)
- Shared business store → Firebase client: uses client (evidence: `src/context/StoreContext.tsx`)
- Authentication state → Firebase client: uses client (evidence: `src/context/AuthContext.tsx`)
- Firebase client → Cloud Firestore: connects to (evidence: `src/lib/firebase.ts`)
- Dashboard → Shared business store: uses data (evidence: `src/components/Dashboard/DashboardView.tsx`)
- Dashboard → Navigation sidebar: navigates via (evidence: `src/components/Dashboard/DashboardView.tsx`)
