# aswinmohammed/vip-web-version architecture

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

- Interactive diagram: https://gitdiagram.com/aswinmohammed/vip-web-version
- Repository: https://github.com/aswinmohammed/vip-web-version

## Overview

VIP Tailors is a multi-branch tailoring ERP. Staff use the React app to manage orders, customers, inventory, employees, sales, expenses, reports and SMS; frontend API helpers send requests to the FastAPI service, which authenticates and scopes access before serving domain APIs backed by PostgreSQL. The graph preserves the README’s major product areas. Some backend routes and frontend features are unsampled, so links are limited to source-index references or documented request flow; no deployment machinery is included.

Main entry points: [`App.tsx`](https://github.com/aswinmohammed/vip-web-version/blob/main/App.tsx) (Application shell), [`backend/app/api/routers`](https://github.com/aswinmohammed/vip-web-version/tree/main/backend/app/api/routers) (Business APIs), [`utils/cloudApi.ts`](https://github.com/aswinmohammed/vip-web-version/blob/main/utils/cloudApi.ts) (Cloud API client), [`backend/app/database.py`](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Application shell<br/>[App.tsx]"]
  node_context["App state<br/>[AppContext.ts]"]
  node_cloud["Cloud API client<br/>[cloudApi.ts]"]
  node_login["Login<br/>[Login.tsx]"]
end

subgraph group_api["API and access"]
  node_api_entry["API application<br/>[main.py]"]
  node_router["API router<br/>[router.py]"]
  node_auth["Authentication API<br/>[auth.py]"]
  node_domain_routes["Business APIs"]
  node_access["Identity and scope<br/>[dependencies.py]"]
  node_security["Token security<br/>[security.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

subgraph group_domain["Tailoring operations"]
  node_orders_ui["Orders and forms<br/>[Orders.tsx]"]
  node_order_form["Order entry<br/>[OrderForm.tsx]"]
  node_customers["Customer management<br/>[Customers.tsx]"]
  node_employees["Employee management"]
  node_inventory["Inventory<br/>[Inventory.tsx]"]
  node_materials["Material sales<br/>[MaterialSales.tsx]"]
  node_suppliers["Supplier management"]
  node_expenses["Expenses<br/>[Expenses.tsx]"]
  node_reports["Reports<br/>[Reports.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_due["Due orders<br/>[DueOrders.tsx]"]
  node_admin["User administration<br/>[UserManagement.tsx]"]
  node_pdf["Invoice PDF service<br/>[pdf.py]"]
end

subgraph group_messaging["SMS operations"]
  node_sms_ui["SMS management<br/>[SmsManagement.tsx]"]
  node_sms_service["SMS service<br/>[sms.py]"]
  node_sms_routes["SMS API<br/>[sms.py]"]
  node_sms_worker["SMS worker<br/>[run_sms_worker.py]"]
end

subgraph group_persistence["Persistence"]
  node_models["Domain models<br/>[models.py]"]
  node_db_session["Database sessions<br/>[database.py]"]
  node_pg[("PostgreSQL")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_app
node_app -->|"renders"| node_orders_ui
node_app -->|"renders"| node_order_form
node_app -->|"renders"| node_customers
node_app -->|"renders"| node_employees
node_app -->|"renders"| node_inventory
node_app -->|"renders"| node_materials
node_app -->|"renders"| node_suppliers
node_app -->|"renders"| node_expenses
node_app -->|"renders"| node_reports
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_due
node_app -->|"renders"| node_login
node_app -->|"renders"| node_admin
node_app -->|"renders"| node_sms_ui
node_order_form -->|"calls"| node_cloud
node_orders_ui -->|"calls"| node_cloud
node_employees -->|"calls"| node_cloud
node_due -->|"calls"| node_cloud
node_sms_ui -->|"calls"| node_cloud
node_cloud -->|"requests API"| node_api_entry
node_api_entry -->|"mounts routes"| node_router
node_router -->|"registers"| node_auth
node_router -->|"registers"| node_domain_routes
node_router -->|"registers"| node_sms_routes
node_auth -->|"uses"| node_access
node_access -->|"validates tokens"| node_security
node_access -->|"opens session"| node_db_session
node_access -->|"queries users"| node_models
node_db_session -->|"loads settings"| node_config
node_domain_routes -->|"uses sessions"| node_db_session
node_domain_routes -->|"uses models"| node_models
node_domain_routes -->|"uses schemas"| node_schemas
node_sms_routes -->|"uses"| node_sms_service
node_domain_routes -->|"queues messages"| node_sms_service
node_domain_routes -->|"uses"| node_pdf
node_sms_worker -->|"runs"| node_sms_service
node_api_entry -->|"configures database"| node_db_session
node_api_entry -->|"loads settings"| node_config
node_db_session -->|"reads and writes"| node_pg

click node_app "https://github.com/aswinmohammed/vip-web-version/blob/main/App.tsx"
click node_context "https://github.com/aswinmohammed/vip-web-version/blob/main/context/AppContext.ts"
click node_cloud "https://github.com/aswinmohammed/vip-web-version/blob/main/utils/cloudApi.ts"
click node_orders_ui "https://github.com/aswinmohammed/vip-web-version/blob/main/components/Orders.tsx"
click node_order_form "https://github.com/aswinmohammed/vip-web-version/blob/main/components/OrderForm.tsx"
click node_customers "https://github.com/aswinmohammed/vip-web-version/blob/main/components/Customers.tsx"
click node_employees "https://github.com/aswinmohammed/vip-web-version/blob/main/components/EmployeeManagement.tsx"
click node_inventory "https://github.com/aswinmohammed/vip-web-version/blob/main/components/Inventory.tsx"
click node_materials "https://github.com/aswinmohammed/vip-web-version/blob/main/components/MaterialSales.tsx"
click node_suppliers "https://github.com/aswinmohammed/vip-web-version/blob/main/components/SupplierManagement.tsx"
click node_expenses "https://github.com/aswinmohammed/vip-web-version/blob/main/components/Expenses.tsx"
click node_reports "https://github.com/aswinmohammed/vip-web-version/blob/main/components/Reports.tsx"
click node_dashboard "https://github.com/aswinmohammed/vip-web-version/blob/main/components/Dashboard.tsx"
click node_due "https://github.com/aswinmohammed/vip-web-version/blob/main/components/DueOrders.tsx"
click node_login "https://github.com/aswinmohammed/vip-web-version/blob/main/components/Login.tsx"
click node_admin "https://github.com/aswinmohammed/vip-web-version/blob/main/components/UserManagement.tsx"
click node_sms_ui "https://github.com/aswinmohammed/vip-web-version/blob/main/components/SmsManagement.tsx"
click node_api_entry "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/main.py"
click node_router "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/api/router.py"
click node_auth "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/api/routers/auth.py"
click node_domain_routes "https://github.com/aswinmohammed/vip-web-version/tree/main/backend/app/api/routers"
click node_access "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/dependencies.py"
click node_security "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/security.py"
click node_schemas "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/schemas.py"
click node_models "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/models.py"
click node_db_session "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/database.py"
click node_config "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/core/config.py"
click node_pdf "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/services/pdf.py"
click node_sms_service "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/services/sms.py"
click node_sms_routes "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/api/routers/sms.py"
click node_sms_worker "https://github.com/aswinmohammed/vip-web-version/blob/main/backend/scripts/run_sms_worker.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_app,node_context,node_cloud,node_login,node_staff toneBlue
class node_api_entry,node_router,node_auth,node_domain_routes,node_access,node_security,node_schemas,node_config toneAmber
class node_orders_ui,node_order_form,node_customers,node_employees,node_inventory,node_materials,node_suppliers,node_expenses,node_reports,node_dashboard,node_due,node_admin,node_pdf toneMint
class node_sms_ui,node_sms_service,node_sms_routes,node_sms_worker toneRose
class node_models,node_db_session,node_pg toneIndigo
```

## Components

### Web application

- [Application shell](https://github.com/aswinmohammed/vip-web-version/blob/main/App.tsx): `App.tsx`
- [App state](https://github.com/aswinmohammed/vip-web-version/blob/main/context/AppContext.ts): `context/AppContext.ts`
- [Cloud API client](https://github.com/aswinmohammed/vip-web-version/blob/main/utils/cloudApi.ts): `utils/cloudApi.ts`
- [Login](https://github.com/aswinmohammed/vip-web-version/blob/main/components/Login.tsx): `components/Login.tsx`

### API and access

- [API application](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/main.py): `backend/app/main.py`
- [API router](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Authentication API](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/api/routers/auth.py): `backend/app/api/routers/auth.py`
- [Business APIs](https://github.com/aswinmohammed/vip-web-version/tree/main/backend/app/api/routers): `backend/app/api/routers`
- [Identity and scope](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/dependencies.py): `backend/app/dependencies.py`
- [Token security](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/security.py): `backend/app/security.py`
- [API schemas](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Runtime settings](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Tailoring operations

- [Orders and forms](https://github.com/aswinmohammed/vip-web-version/blob/main/components/Orders.tsx): `components/Orders.tsx`
- [Order entry](https://github.com/aswinmohammed/vip-web-version/blob/main/components/OrderForm.tsx): `components/OrderForm.tsx`
- [Customer management](https://github.com/aswinmohammed/vip-web-version/blob/main/components/Customers.tsx): `components/Customers.tsx`
- [Employee management](https://github.com/aswinmohammed/vip-web-version/blob/main/components/EmployeeManagement.tsx): `components/EmployeeManagement.tsx`
- [Inventory](https://github.com/aswinmohammed/vip-web-version/blob/main/components/Inventory.tsx): `components/Inventory.tsx`
- [Material sales](https://github.com/aswinmohammed/vip-web-version/blob/main/components/MaterialSales.tsx): `components/MaterialSales.tsx`
- [Supplier management](https://github.com/aswinmohammed/vip-web-version/blob/main/components/SupplierManagement.tsx): `components/SupplierManagement.tsx`
- [Expenses](https://github.com/aswinmohammed/vip-web-version/blob/main/components/Expenses.tsx): `components/Expenses.tsx`
- [Reports](https://github.com/aswinmohammed/vip-web-version/blob/main/components/Reports.tsx): `components/Reports.tsx`
- [Dashboard](https://github.com/aswinmohammed/vip-web-version/blob/main/components/Dashboard.tsx): `components/Dashboard.tsx`
- [Due orders](https://github.com/aswinmohammed/vip-web-version/blob/main/components/DueOrders.tsx): `components/DueOrders.tsx`
- [User administration](https://github.com/aswinmohammed/vip-web-version/blob/main/components/UserManagement.tsx): `components/UserManagement.tsx`
- [Invoice PDF service](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/services/pdf.py): `backend/app/services/pdf.py`

### SMS operations

- [SMS management](https://github.com/aswinmohammed/vip-web-version/blob/main/components/SmsManagement.tsx): `components/SmsManagement.tsx`
- [SMS service](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/services/sms.py): `backend/app/services/sms.py`
- [SMS API](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/api/routers/sms.py): `backend/app/api/routers/sms.py`
- [SMS worker](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/scripts/run_sms_worker.py): `backend/scripts/run_sms_worker.py`

### Persistence

- [Domain models](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database sessions](https://github.com/aswinmohammed/vip-web-version/blob/main/backend/app/database.py): `backend/app/database.py`
- **PostgreSQL**

### Other components

- **Staff user**

## Connections

- Staff user → Application shell: uses (evidence: `README.md`)
- Application shell → Orders and forms: renders (evidence: `App.tsx`)
- Application shell → Order entry: renders (evidence: `App.tsx`)
- Application shell → Customer management: renders (evidence: `App.tsx`)
- Application shell → Employee management: renders (evidence: `App.tsx`)
- Application shell → Inventory: renders (evidence: `App.tsx`)
- Application shell → Material sales: renders (evidence: `App.tsx`)
- Application shell → Supplier management: renders (evidence: `App.tsx`)
- Application shell → Expenses: renders (evidence: `App.tsx`)
- Application shell → Reports: renders (evidence: `App.tsx`)
- Application shell → Dashboard: renders (evidence: `App.tsx`)
- Application shell → Due orders: renders (evidence: `App.tsx`)
- Application shell → Login: renders (evidence: `App.tsx`)
- Application shell → User administration: renders (evidence: `App.tsx`)
- Application shell → SMS management: renders (evidence: `App.tsx`)
- Order entry → Cloud API client: calls (evidence: `utils/cloudApi.ts`)
- Orders and forms → Cloud API client: calls (evidence: `utils/cloudApi.ts`)
- Employee management → Cloud API client: calls (evidence: `components/EmployeeManagement.tsx`)
- Due orders → Cloud API client: calls (evidence: `components/DueOrders.tsx`)
- SMS management → Cloud API client: calls (evidence: `utils/cloudApi.ts`)
- Cloud API client → API application: requests API (evidence: `README.md`)
- API application → API router: mounts routes (evidence: `backend/app/main.py`)
- API router → Authentication API: registers (evidence: `backend/app/api/router.py`)
- API router → Business APIs: registers (evidence: `backend/app/api/router.py`)
- API router → SMS API: registers (evidence: `backend/app/api/router.py`)
- Authentication API → Identity and scope: uses (evidence: `backend/app/api/routers/auth.py`)
- Identity and scope → Token security: validates tokens (evidence: `backend/app/dependencies.py`)
- Identity and scope → Database sessions: opens session (evidence: `backend/app/dependencies.py`)
- Identity and scope → Domain models: queries users (evidence: `backend/app/dependencies.py`)
- Database sessions → Runtime settings: loads settings (evidence: `backend/app/database.py`)
- Business APIs → Database sessions: uses sessions (evidence: `backend/app/api/routers/orders.py`)
- Business APIs → Domain models: uses models (evidence: `backend/app/api/routers/orders.py`)
- Business APIs → API schemas: uses schemas (evidence: `backend/app/api/routers/orders.py`)
- SMS API → SMS service: uses (evidence: `backend/app/api/routers/sms.py`)
- Business APIs → SMS service: queues messages (evidence: `backend/app/api/routers/orders.py`)
- Business APIs → Invoice PDF service: uses (evidence: `backend/app/api/routers/orders.py`)
- SMS worker → SMS service: runs (evidence: `backend/scripts/run_sms_worker.py`)
- API application → Database sessions: configures database (evidence: `backend/app/main.py`)
- API application → Runtime settings: loads settings (evidence: `backend/app/main.py`)
- Database sessions → PostgreSQL: reads and writes (evidence: `README.md`)
