# saniyamaner786/smart-inventory-vision architecture

> Architecture diagram of the GitHub repository saniyamaner786/smart-inventory-vision, 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/saniyamaner786/smart-inventory-vision
- Repository: https://github.com/saniyamaner786/smart-inventory-vision

## Overview

Smart Inventory Vision is a Streamlit retail-shelf monitoring and inventory application. An operator enters through Home, selects a feature, and can run webcam-based product monitoring; detections are exposed through Streamlit session state for inventory, planogram, predictive, and analytics views. Inventory_DB preserves records in SQLite, which Audit reads for sales and demand summaries. The graph reflects shown routing, session-state use, and database access; several feature implementations are only partially excerpted, so uncertain connections are omitted.

Main entry points: [`Home.py`](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Home.py) (Page router), [`Monitoring.py`](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Monitoring.py) (Live session data), [`Inventory_DB.py`](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Inventory_DB.py) (Inventory history), [`Predictive.py`](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Predictive.py) (Stock prediction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_home["Page router<br/>[Home.py]"]
end

subgraph group_shelf["Shelf monitoring"]
  node_monitoring["Live monitoring<br/>[Monitoring.py]"]
  node_detector["YOLO shelf analysis<br/>[utils.py]"]
  node_live_state[("Live session data<br/>[Monitoring.py]")]
end

subgraph group_inventory["Inventory operations"]
  node_inventory_ui["Inventory history<br/>[Inventory_DB.py]"]
  node_inventory_db[("Inventory records<br/>[inventory.db]")]
  node_warehouse_csv[("Warehouse stock")]
end

subgraph group_insights["Business insights"]
  node_predictive["Stock prediction<br/>[Predictive.py]"]
  node_audit["Business audit<br/>[Audit.py]"]
  node_analytics["Store analytics<br/>[Analytics.py]"]
  node_planogram["Planogram checks<br/>[Planogram.py]"]
end

node_operator(("Store operator"))

node_operator -->|"selects pages"| node_home
node_home -->|"routes to"| node_monitoring
node_home -->|"routes to"| node_inventory_ui
node_home -->|"routes to"| node_predictive
node_home -->|"routes to"| node_audit
node_home -->|"routes to"| node_analytics
node_home -->|"routes to"| node_planogram
node_monitoring -->|"analyzes frames"| node_detector
node_monitoring -->|"updates counts"| node_live_state
node_inventory_ui -->|"reads counts"| node_live_state
node_inventory_ui -->|"writes and reads"| node_inventory_db
node_audit -->|"queries records"| node_inventory_db
node_analytics -->|"reads counts"| node_live_state
node_planogram -->|"reads counts"| node_live_state
node_predictive -->|"reads counts"| node_live_state
node_predictive -->|"updates stock"| node_warehouse_csv

click node_home "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Home.py"
click node_monitoring "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Monitoring.py"
click node_detector "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/utils.py"
click node_live_state "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Monitoring.py"
click node_inventory_ui "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Inventory_DB.py"
click node_inventory_db "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/inventory.db"
click node_warehouse_csv "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/warehouse_stock.csv"
click node_predictive "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Predictive.py"
click node_audit "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Audit.py"
click node_analytics "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Analytics.py"
click node_planogram "https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Planogram.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_home toneBlue
class node_monitoring,node_detector,node_live_state toneAmber
class node_inventory_ui,node_inventory_db,node_warehouse_csv toneMint
class node_predictive,node_audit,node_analytics,node_planogram toneRose
class node_operator toneIndigo
```

## Components

### App navigation

- [Page router](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Home.py): `Home.py`

### Shelf monitoring

- [Live monitoring](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Monitoring.py): `Monitoring.py`
- [YOLO shelf analysis](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/utils.py): `utils.py`
- [Live session data](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Monitoring.py): `Monitoring.py`

### Inventory operations

- [Inventory history](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Inventory_DB.py): `Inventory_DB.py`
- [Inventory records](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/inventory.db): `inventory.db`
- [Warehouse stock](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/warehouse_stock.csv): `warehouse_stock.csv`

### Business insights

- [Stock prediction](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Predictive.py): `Predictive.py`
- [Business audit](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Audit.py): `Audit.py`
- [Store analytics](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Analytics.py): `Analytics.py`
- [Planogram checks](https://github.com/saniyamaner786/smart-inventory-vision/blob/main/Planogram.py): `Planogram.py`

### Other components

- **Store operator**

## Connections

- Store operator → Page router: selects pages (evidence: `Home.py`)
- Page router → Live monitoring: routes to (evidence: `Home.py`)
- Page router → Inventory history: routes to (evidence: `Home.py`)
- Page router → Stock prediction: routes to (evidence: `Home.py`)
- Page router → Business audit: routes to (evidence: `Home.py`)
- Page router → Store analytics: routes to (evidence: `Home.py`)
- Page router → Planogram checks: routes to (evidence: `Home.py`)
- Live monitoring → YOLO shelf analysis: analyzes frames (evidence: `Monitoring.py`)
- Live monitoring → Live session data: updates counts (evidence: `Monitoring.py`)
- Inventory history → Live session data: reads counts (evidence: `Inventory_DB.py`)
- Inventory history → Inventory records: writes and reads (evidence: `Inventory_DB.py`)
- Business audit → Inventory records: queries records (evidence: `Audit.py`)
- Store analytics → Live session data: reads counts (evidence: `Analytics.py`)
- Planogram checks → Live session data: reads counts (evidence: `Planogram.py`)
- Stock prediction → Live session data: reads counts (evidence: `Predictive.py`)
- Stock prediction → Warehouse stock: updates stock (evidence: `Predictive.py`)
