# mithunaradya-ai/teammitras-solo architecture

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

- Interactive diagram: https://gitdiagram.com/mithunaradya-ai/teammitras-solo
- Repository: https://github.com/mithunaradya-ai/teammitras-solo

## Overview

SlotIQ is a warehouse slotting optimizer with a React dashboard and FastAPI backend. The main workflow is uploading warehouse CSVs for cleaning, running and comparing slot-assignment strategies, then inspecting placements and operational impact. The README documents forecasting, co-purchase affinity, explainability, and move/payback analysis as product capabilities. Some engine-to-API wiring and page request details are unsampled, so those links are marked unverified rather than asserted as observed calls.

Main entry points: [`api/main.py`](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/api/main.py) (REST API), [`web/src/App.jsx`](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/App.jsx) (Dashboard shell), [`engine/strategies.py`](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/strategies.py) (Slot strategies), [`engine/metrics.py`](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/metrics.py) (Operational metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Dashboard shell<br/>[App.jsx]"]
  node_upload["CSV audit<br/>[UploadPage.jsx]"]
  node_leaderboard["Strategy comparison"]
  node_heatmap["Layout heatmap<br/>[HeatmapPage.jsx]"]
  node_lookup["SKU explanation<br/>[LookupPage.jsx]"]
  node_whatif["Demand scenarios<br/>[WhatIfPage.jsx]"]
  node_reslotview["Move plan view<br/>[ReslotPage.jsx]"]
end

subgraph group_service["API Service"]
  node_api["REST API<br/>[main.py]"]
end

subgraph group_engine["Optimization Engine"]
  node_validator["Data cleaning<br/>[validator.py]"]
  node_strategies["Slot strategies<br/>[strategies.py]"]
  node_forecast["Demand forecast<br/>[forecast.py]"]
  node_affinity["Basket affinity<br/>[affinity.py]"]
  node_metrics["Operational metrics<br/>[metrics.py]"]
  node_explain["Placement rationale<br/>[explain.py]"]
  node_reslot["ROI move planning<br/>[reslot.py]"]
  node_generator["Synthetic data<br/>[data_gen.py]"]
end

subgraph group_data["Warehouse Data"]
  node_csvdata["Warehouse CSVs"]
end

node_operator(("Warehouse user"))

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_upload
node_app -->|"renders"| node_leaderboard
node_app -->|"renders"| node_heatmap
node_app -->|"renders"| node_lookup
node_app -->|"renders"| node_whatif
node_app -->|"renders"| node_reslotview
node_upload -->|"uploads CSV"| node_api
node_leaderboard -->|"requests comparison"| node_api
node_heatmap -->|"requests layouts"| node_api
node_lookup -->|"requests SKU"| node_api
node_whatif -.->|"scenario request"| node_api
node_reslotview -.->|"loads move plan"| node_api
node_api -.->|"validates uploads"| node_validator
node_api -.->|"runs optimization"| node_strategies
node_api -.->|"serves metrics"| node_metrics
node_api -.->|"serves rationale"| node_explain
node_api -.->|"serves ROI plan"| node_reslot
node_strategies -->|"forecasts demand"| node_forecast
node_strategies -->|"optimizes affinity"| node_affinity
node_strategies -->|"calculates metrics"| node_metrics
node_affinity -->|"checks feasibility"| node_metrics
node_csvdata -.->|"input data"| node_validator
node_generator -.->|"generates datasets"| node_csvdata

click node_app "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/App.jsx"
click node_upload "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/UploadPage.jsx"
click node_leaderboard "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/LeaderboardPage.jsx"
click node_heatmap "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/HeatmapPage.jsx"
click node_lookup "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/LookupPage.jsx"
click node_whatif "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/WhatIfPage.jsx"
click node_reslotview "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/ReslotPage.jsx"
click node_api "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/api/main.py"
click node_validator "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/validator.py"
click node_strategies "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/strategies.py"
click node_forecast "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/forecast.py"
click node_affinity "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/affinity.py"
click node_metrics "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/metrics.py"
click node_explain "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/explain.py"
click node_reslot "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/reslot.py"
click node_generator "https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/data_gen.py"
click node_csvdata "https://github.com/mithunaradya-ai/teammitras-solo/tree/main/data"

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_upload,node_leaderboard,node_heatmap,node_lookup,node_whatif,node_reslotview,node_operator toneBlue
class node_api toneAmber
class node_validator,node_strategies,node_forecast,node_affinity,node_metrics,node_explain,node_reslot,node_generator toneMint
class node_csvdata toneRose
```

## Components

### Dashboard

- [Dashboard shell](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [CSV audit](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/UploadPage.jsx): `web/src/pages/UploadPage.jsx`
- [Strategy comparison](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/LeaderboardPage.jsx): `web/src/pages/LeaderboardPage.jsx`
- [Layout heatmap](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/HeatmapPage.jsx): `web/src/pages/HeatmapPage.jsx`
- [SKU explanation](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/LookupPage.jsx): `web/src/pages/LookupPage.jsx`
- [Demand scenarios](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/WhatIfPage.jsx): `web/src/pages/WhatIfPage.jsx`
- [Move plan view](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/web/src/pages/ReslotPage.jsx): `web/src/pages/ReslotPage.jsx`

### API Service

- [REST API](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/api/main.py): `api/main.py`

### Optimization Engine

- [Data cleaning](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/validator.py): `engine/validator.py`
- [Slot strategies](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/strategies.py): `engine/strategies.py`
- [Demand forecast](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/forecast.py): `engine/forecast.py`
- [Basket affinity](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/affinity.py): `engine/affinity.py`
- [Operational metrics](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/metrics.py): `engine/metrics.py`
- [Placement rationale](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/explain.py): `engine/explain.py`
- [ROI move planning](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/reslot.py): `engine/reslot.py`
- [Synthetic data](https://github.com/mithunaradya-ai/teammitras-solo/blob/main/engine/data_gen.py): `engine/data_gen.py`

### Warehouse Data

- [Warehouse CSVs](https://github.com/mithunaradya-ai/teammitras-solo/tree/main/data): `data`

### Other components

- **Warehouse user**

## Connections

- Warehouse user → Dashboard shell: uses (evidence: `README.md`)
- Dashboard shell → CSV audit: renders (evidence: `web/src/App.jsx`)
- Dashboard shell → Strategy comparison: renders (evidence: `web/src/App.jsx`)
- Dashboard shell → Layout heatmap: renders (evidence: `web/src/App.jsx`)
- Dashboard shell → SKU explanation: renders (evidence: `web/src/App.jsx`)
- Dashboard shell → Demand scenarios: renders (evidence: `web/src/App.jsx`)
- Dashboard shell → Move plan view: renders (evidence: `web/src/App.jsx`)
- CSV audit → REST API: uploads CSV (evidence: `web/src/pages/UploadPage.jsx`)
- Strategy comparison → REST API: requests comparison (evidence: `web/src/pages/LeaderboardPage.jsx`)
- Layout heatmap → REST API: requests layouts (evidence: `web/src/pages/HeatmapPage.jsx`)
- SKU explanation → REST API: requests SKU (evidence: `web/src/pages/LookupPage.jsx`)
- Demand scenarios → REST API: scenario request
- Move plan view → REST API: loads move plan
- REST API → Data cleaning: validates uploads
- REST API → Slot strategies: runs optimization
- REST API → Operational metrics: serves metrics
- REST API → Placement rationale: serves rationale
- REST API → ROI move planning: serves ROI plan
- Slot strategies → Demand forecast: forecasts demand (evidence: `engine/strategies.py`)
- Slot strategies → Basket affinity: optimizes affinity (evidence: `engine/strategies.py`)
- Slot strategies → Operational metrics: calculates metrics (evidence: `engine/strategies.py`)
- Basket affinity → Operational metrics: checks feasibility (evidence: `engine/affinity.py`)
- Warehouse CSVs → Data cleaning: input data
- Synthetic data → Warehouse CSVs: generates datasets
