# sujithkb24/intelligent_inventory_management_vcet architecture

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

- Interactive diagram: https://gitdiagram.com/sujithkb24/intelligent_inventory_management_vcet
- Repository: https://github.com/sujithkb24/intelligent_inventory_management_vcet

## Overview

EV Smart Inventory Intelligence is a web platform for monitoring EV-manufacturing inventory, forecasting supply and order risk, allocating materials, simulating disruptions, and preparing procurement recommendations for human approval. Users authenticate, inspect operational views, and can investigate issues through a conversational agent; the backend exposes API capabilities and maintains operational state. The README documents the business workflow, while the excerpts show application routing, backend router registration, agent-to-NLU delegation, and authentication behavior. Many service implementations were not sampled, so their internal call relationships are omitted or shown only as documented capabilities.

Main entry points: [`backend/app/db.py`](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/db.py) (Operational store), [`backend/app/routers`](https://github.com/sujithkb24/intelligent_inventory_management_vcet/tree/main/backend/app/routers) (API routes), [`backend/app/services/risk.py`](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/risk.py) (Risk assessment), [`client1/src/App.tsx`](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/App.tsx) (Operational views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["Operational views<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_approval["Human review<br/>[ApprovalDialog.tsx]"]
end

subgraph group_access["API and access"]
  node_server["FastAPI application<br/>[main.py]"]
  node_routers["API routes"]
  node_access_control["Role checks<br/>[deps.py]"]
end

subgraph group_operations["Inventory operations"]
  node_store[("Operational store<br/>[db.py]")]
  node_ingestion["Data ingestion<br/>[ingestion.py]"]
  node_inventory["Inventory analysis<br/>[inventory.py]"]
  node_bom["BOM tracking<br/>[bom.py]"]
  node_allocation["Order allocation<br/>[allocation.py]"]
end

subgraph group_decision["Risk and procurement"]
  node_risk["Risk assessment<br/>[risk.py]"]
  node_ml["Risk prediction"]
  node_simulation["Scenario simulation<br/>[simulation.py]"]
  node_alerts["Alerts and events<br/>[alerts.py]"]
  node_event_stream["Event delivery<br/>[event_stream.py]"]
  node_nlu["Question interpretation<br/>[detector.py]"]
  node_agent["Procurement agent<br/>[runner.py]"]
  node_procurement["Purchase recommendations<br/>[procurement.py]"]
end

node_user(("Planning user"))

node_user -->|"uses"| node_web
node_web -->|"requires access"| node_auth
node_web -.->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_server
node_server -->|"registers routes"| node_routers
node_routers -.->|"checks roles"| node_access_control
node_routers -.->|"reads and writes"| node_store
node_ingestion -.->|"records inputs"| node_store
node_inventory -.->|"reads stock"| node_store
node_bom -->|"tracks materials"| node_inventory
node_allocation -->|"allocates stock"| node_inventory
node_risk -->|"predicts delays"| node_ml
node_risk -.->|"stores assessments"| node_store
node_simulation -->|"compares risk"| node_risk
node_alerts -.->|"surfaces risk"| node_risk
node_event_stream -->|"drains outbox"| node_store
node_routers -.->|"handles questions"| node_nlu
node_nlu -->|"delegates investigation"| node_agent
node_agent -->|"drafts recommendations"| node_procurement
node_procurement -->|"presents drafts"| node_approval
node_approval -->|"requests decision"| node_user

click node_web "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/App.tsx"
click node_auth "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/auth/AuthContext.tsx"
click node_api_client "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/api/client.ts"
click node_server "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/main.py"
click node_routers "https://github.com/sujithkb24/intelligent_inventory_management_vcet/tree/main/backend/app/routers"
click node_access_control "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/routers/deps.py"
click node_store "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/db.py"
click node_ingestion "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/ingestion.py"
click node_inventory "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/inventory.py"
click node_bom "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/bom.py"
click node_allocation "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/allocation.py"
click node_risk "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/risk.py"
click node_ml "https://github.com/sujithkb24/intelligent_inventory_management_vcet/tree/main/backend/app/ml"
click node_simulation "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/simulation.py"
click node_alerts "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/alerts.py"
click node_event_stream "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/event_stream.py"
click node_nlu "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/nlu/detector.py"
click node_agent "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/agent/runner.py"
click node_procurement "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/procurement.py"
click node_approval "https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/components/approval/ApprovalDialog.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_web,node_auth,node_api_client,node_approval,node_user toneBlue
class node_server,node_routers,node_access_control toneAmber
class node_store,node_ingestion,node_inventory,node_bom,node_allocation toneMint
class node_risk,node_ml,node_simulation,node_alerts,node_event_stream,node_nlu,node_agent,node_procurement toneRose
```

## Components

### Web application

- [Operational views](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/App.tsx): `client1/src/App.tsx`
- [Authentication](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/auth/AuthContext.tsx): `client1/src/auth/AuthContext.tsx`
- [API client](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/api/client.ts): `client1/src/api/client.ts`
- [Human review](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/client1/src/components/approval/ApprovalDialog.tsx): `client1/src/components/approval/ApprovalDialog.tsx`

### API and access

- [FastAPI application](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routes](https://github.com/sujithkb24/intelligent_inventory_management_vcet/tree/main/backend/app/routers): `backend/app/routers`
- [Role checks](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/routers/deps.py): `backend/app/routers/deps.py`

### Inventory operations

- [Operational store](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/db.py): `backend/app/db.py`
- [Data ingestion](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/ingestion.py): `backend/app/services/ingestion.py`
- [Inventory analysis](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/inventory.py): `backend/app/services/inventory.py`
- [BOM tracking](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/bom.py): `backend/app/services/bom.py`
- [Order allocation](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/allocation.py): `backend/app/services/allocation.py`

### Risk and procurement

- [Risk assessment](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/risk.py): `backend/app/services/risk.py`
- [Risk prediction](https://github.com/sujithkb24/intelligent_inventory_management_vcet/tree/main/backend/app/ml): `backend/app/ml`
- [Scenario simulation](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/simulation.py): `backend/app/services/simulation.py`
- [Alerts and events](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/alerts.py): `backend/app/services/alerts.py`
- [Event delivery](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/event_stream.py): `backend/app/services/event_stream.py`
- [Question interpretation](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/nlu/detector.py): `backend/app/nlu/detector.py`
- [Procurement agent](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/agent/runner.py): `backend/app/agent/runner.py`
- [Purchase recommendations](https://github.com/sujithkb24/intelligent_inventory_management_vcet/blob/main/backend/app/services/procurement.py): `backend/app/services/procurement.py`

### Other components

- **Planning user**

## Connections

- Planning user → Operational views: uses
- Operational views → Authentication: requires access (evidence: `client1/src/App.tsx`)
- Operational views → API client: requests data
- API client → FastAPI application: calls API
- FastAPI application → API routes: registers routes (evidence: `backend/app/main.py`)
- API routes → Role checks: checks roles
- API routes → Operational store: reads and writes
- Data ingestion → Operational store: records inputs
- Inventory analysis → Operational store: reads stock
- BOM tracking → Inventory analysis: tracks materials
- Order allocation → Inventory analysis: allocates stock
- Risk assessment → Risk prediction: predicts delays
- Risk assessment → Operational store: stores assessments
- Scenario simulation → Risk assessment: compares risk
- Alerts and events → Risk assessment: surfaces risk
- Event delivery → Operational store: drains outbox (evidence: `backend/app/main.py`)
- API routes → Question interpretation: handles questions
- Question interpretation → Procurement agent: delegates investigation (evidence: `backend/app/nlu/detector.py`)
- Procurement agent → Purchase recommendations: drafts recommendations
- Purchase recommendations → Human review: presents drafts
- Human review → Planning user: requests decision
