# erpro272/originial_erp architecture

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

- Interactive diagram: https://gitdiagram.com/erpro272/originial_erp
- Repository: https://github.com/erpro272/originial_erp

## Overview

Manufacturing ERP for Indian manufacturers, organized as a React client and a FastAPI modular monolith. The user-facing flow spans customer and catalog records, order intake and prioritization, factory planning, invoice review, and the broader purchasing, production, billing, and finance capabilities documented in the README. The planning engine is a distinct scheduling layer. Source excerpts are partial, so several documented domains appear without inferred runtime links; the API’s router registration and selected service calls are shown where supported.

Main entry points: [`backend/app/main.py`](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/main.py) (FastAPI application), [`frontend/src/app/App.tsx`](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/frontend/src/app/App.tsx) (ERP web app), [`backend/app/invoices/service.py`](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/invoices/service.py) (Invoice processing), [`backend/app/core/storage.py`](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/core/storage.py) (Encrypted file storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["ERP web app<br/>[App.tsx]"]
  node_customerui["Customer screens"]
  node_orderui["Order screens"]
  node_planningui["Planning screens"]
  node_invoiceui["Invoice review<br/>[ReviewPage.tsx]"]
  node_httpclient["API client<br/>[client.ts]"]
end

subgraph group_api["ERP API"]
  node_apiapp["FastAPI application<br/>[main.py]"]
end

subgraph group_shared["Platform services"]
  node_coredata[("Tenant and audit data<br/>[models.py]")]
  node_storage["Encrypted file storage<br/>[storage.py]"]
  node_ai["AI extraction service<br/>[service.py]"]
end

subgraph group_operations["Business operations"]
  node_customers["Customer management<br/>[service.py]"]
  node_catalog["Product catalog<br/>[service.py]"]
  node_orders["Orders and ranking<br/>[service.py]"]
  node_planning["Factory planning<br/>[service.py]"]
  node_schedule{{"Scheduling engine<br/>[engine.py]"}}
  node_purchasing["Purchasing"]
  node_production["Production"]
end

subgraph group_money["Billing and finance"]
  node_invoices["Invoice processing<br/>[service.py]"]
  node_finance["Finance"]
end

node_user(("ERP user"))
node_objectstore[("S3-compatible storage")]

node_user -->|"uses"| node_webapp
node_apiapp -->|"mounts routes"| node_customers
node_apiapp -->|"mounts routes"| node_catalog
node_apiapp -->|"mounts routes"| node_orders
node_apiapp -->|"mounts routes"| node_planning
node_apiapp -->|"mounts routes"| node_invoices
node_orders -->|"looks up products"| node_catalog
node_planning -->|"computes plan"| node_schedule
node_invoices -->|"uses file storage"| node_storage
node_storage -->|"stores objects"| node_objectstore
node_webapp -.->|"presents screens"| node_customerui
node_webapp -.->|"presents screens"| node_orderui
node_webapp -.->|"presents screens"| node_planningui
node_webapp -.->|"presents screens"| node_invoiceui
node_httpclient -.->|"calls API"| node_apiapp
node_invoices -.->|"extracts invoice data"| node_ai

click node_webapp "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/frontend/src/app/App.tsx"
click node_customerui "https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/frontend/src/modules/customers"
click node_orderui "https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/frontend/src/modules/orders"
click node_planningui "https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/frontend/src/modules/planning"
click node_invoiceui "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/frontend/src/modules/invoices/ReviewPage.tsx"
click node_httpclient "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/frontend/src/api/client.ts"
click node_apiapp "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/main.py"
click node_customers "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/customers/service.py"
click node_catalog "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/catalog/service.py"
click node_orders "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/orders/service.py"
click node_planning "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/planning/service.py"
click node_schedule "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/planning/engine.py"
click node_purchasing "https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/backend/app/purchasing"
click node_production "https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/backend/app/production"
click node_invoices "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/invoices/service.py"
click node_finance "https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/backend/app/finance"
click node_coredata "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/core/models.py"
click node_storage "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/core/storage.py"
click node_ai "https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/ai/service.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_webapp,node_customerui,node_orderui,node_planningui,node_invoiceui,node_httpclient,node_user toneBlue
class node_apiapp,node_objectstore toneAmber
class node_coredata,node_storage,node_ai toneMint
class node_customers,node_catalog,node_orders,node_planning,node_schedule,node_purchasing,node_production toneRose
class node_invoices,node_finance toneIndigo
```

## Components

### Web application

- [ERP web app](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Customer screens](https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/frontend/src/modules/customers): `frontend/src/modules/customers`
- [Order screens](https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/frontend/src/modules/orders): `frontend/src/modules/orders`
- [Planning screens](https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/frontend/src/modules/planning): `frontend/src/modules/planning`
- [Invoice review](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/frontend/src/modules/invoices/ReviewPage.tsx): `frontend/src/modules/invoices/ReviewPage.tsx`
- [API client](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### ERP API

- [FastAPI application](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/main.py): `backend/app/main.py`

### Platform services

- [Tenant and audit data](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/core/models.py): `backend/app/core/models.py`
- [Encrypted file storage](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/core/storage.py): `backend/app/core/storage.py`
- [AI extraction service](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/ai/service.py): `backend/app/ai/service.py`

### Business operations

- [Customer management](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/customers/service.py): `backend/app/customers/service.py`
- [Product catalog](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/catalog/service.py): `backend/app/catalog/service.py`
- [Orders and ranking](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/orders/service.py): `backend/app/orders/service.py`
- [Factory planning](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/planning/service.py): `backend/app/planning/service.py`
- [Scheduling engine](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/planning/engine.py): `backend/app/planning/engine.py`
- [Purchasing](https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/backend/app/purchasing): `backend/app/purchasing`
- [Production](https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/backend/app/production): `backend/app/production`

### Billing and finance

- [Invoice processing](https://github.com/erpro272/originial_erp/blob/claude/sweet-thompson-f1hjgv/backend/app/invoices/service.py): `backend/app/invoices/service.py`
- [Finance](https://github.com/erpro272/originial_erp/tree/claude/sweet-thompson-f1hjgv/backend/app/finance): `backend/app/finance`

### Other components

- **ERP user**
- **S3-compatible storage**

## Connections

- ERP user → ERP web app: uses (evidence: `README.md`)
- FastAPI application → Customer management: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Product catalog: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Orders and ranking: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Factory planning: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Invoice processing: mounts routes (evidence: `backend/app/main.py`)
- Orders and ranking → Product catalog: looks up products (evidence: `backend/app/orders/service.py`)
- Factory planning → Scheduling engine: computes plan (evidence: `backend/app/planning/service.py`)
- Invoice processing → Encrypted file storage: uses file storage (evidence: `backend/app/invoices/service.py`)
- Encrypted file storage → S3-compatible storage: stores objects (evidence: `backend/app/core/storage.py`)
- ERP web app → Customer screens: presents screens
- ERP web app → Order screens: presents screens
- ERP web app → Planning screens: presents screens
- ERP web app → Invoice review: presents screens
- API client → FastAPI application: calls API
- Invoice processing → AI extraction service: extracts invoice data
