# khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform architecture

> Architecture diagram of the GitHub repository khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform
- Repository: https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform

## Overview

FORESIGHT is a retail demand and inventory analytics application. Its documented workflow prepares sales data, explores it, engineers forecasting features, trains a demand model, scores inventory risk, and presents results in a Streamlit dashboard. The sampled scripts support the preparation, feature, model, risk, and dashboard data-loading stages. Dashboard pages and forecasting views are documented, but their implementation details are only partly sampled; the README also describes the overall workflow, so some page-level relationships are documented rather than source-verified.

Main entry points: [`app.py`](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py) (Streamlit dashboard), [`outputs`](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/outputs) (Clean sales data), [`src/05_risk.py`](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/05_risk.py) (Risk scoring), [`src/01_clean.py`](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/01_clean.py) (Sales cleaning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_retaildata["Retail source data"]
  node_cleaning["Sales cleaning<br/>[01_clean.py]"]
  node_cleaned["Clean sales data"]
end

subgraph group_analysis["Forecasting analysis"]
  node_eda["Sales exploration<br/>[02_eda.py]"]
  node_features["Feature engineering<br/>[03_features.py]"]
  node_featuredata["Forecast features"]
  node_training["Model training<br/>[04_modeling.py]"]
  node_modelstore["Saved model assets"]
end

subgraph group_risk["Inventory risk"]
  node_riskcalc["Risk scoring<br/>[05_risk.py]"]
  node_inventorydata["Inventory and SKU data"]
  node_riskscores["Risk results"]
end

subgraph group_dashboard["Business dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_salesview["Sales analytics<br/>[app.py]"]
  node_forecastview["Demand forecast<br/>[app.py]"]
  node_inventoryview["Inventory monitoring<br/>[app.py]"]
  node_riskview["Risk dashboard<br/>[app.py]"]
  node_productview["Product details<br/>[app.py]"]
  node_executiveview["Executive summary<br/>[app.py]"]
end

node_user(("Retail user"))

node_retaildata -->|"provides inputs"| node_cleaning
node_cleaning -->|"writes cleaned data"| node_cleaned
node_cleaned -->|"reads sales data"| node_eda
node_cleaned -->|"reads sales data"| node_features
node_features -->|"writes features"| node_featuredata
node_featuredata -->|"supplies training data"| node_training
node_training -->|"saves model assets"| node_modelstore
node_featuredata -->|"supplies feature data"| node_riskcalc
node_modelstore -->|"loads model assets"| node_riskcalc
node_inventorydata -->|"supplies inventory details"| node_riskcalc
node_riskcalc -->|"writes risk scores"| node_riskscores
node_user -->|"uses"| node_dashboard
node_dashboard -->|"presents sales insights"| node_salesview
node_dashboard -->|"presents demand forecasts"| node_forecastview
node_dashboard -->|"presents inventory analysis"| node_inventoryview
node_dashboard -->|"presents risk analysis"| node_riskview
node_dashboard -->|"presents product details"| node_productview
node_dashboard -->|"presents executive insights"| node_executiveview
node_cleaned -->|"loads sales results"| node_dashboard
node_riskscores -->|"loads risk results"| node_dashboard

click node_retaildata "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/data"
click node_cleaning "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/01_clean.py"
click node_cleaned "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/outputs"
click node_eda "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/02_eda.py"
click node_features "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/03_features.py"
click node_featuredata "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/outputs"
click node_training "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/04_modeling.py"
click node_modelstore "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/models"
click node_riskcalc "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/05_risk.py"
click node_inventorydata "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/data"
click node_riskscores "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/outputs"
click node_dashboard "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py"
click node_salesview "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py"
click node_forecastview "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py"
click node_inventoryview "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py"
click node_riskview "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py"
click node_productview "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py"
click node_executiveview "https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.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_retaildata,node_cleaning,node_cleaned,node_user toneBlue
class node_eda,node_features,node_featuredata,node_training,node_modelstore toneAmber
class node_riskcalc,node_inventorydata,node_riskscores toneMint
class node_dashboard,node_salesview,node_forecastview,node_inventoryview,node_riskview,node_productview,node_executiveview toneRose
```

## Components

### Data preparation

- [Retail source data](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/data): `data`
- [Sales cleaning](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/01_clean.py): `src/01_clean.py`
- [Clean sales data](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/outputs): `outputs`

### Forecasting analysis

- [Sales exploration](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/02_eda.py): `src/02_eda.py`
- [Feature engineering](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/03_features.py): `src/03_features.py`
- [Forecast features](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/outputs): `outputs`
- [Model training](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/04_modeling.py): `src/04_modeling.py`
- [Saved model assets](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/models): `models`

### Inventory risk

- [Risk scoring](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/src/05_risk.py): `src/05_risk.py`
- [Inventory and SKU data](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/data): `data`
- [Risk results](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/tree/main/outputs): `outputs`

### Business dashboard

- [Streamlit dashboard](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py): `app.py`
- [Sales analytics](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py): `app.py`
- [Demand forecast](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py): `app.py`
- [Inventory monitoring](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py): `app.py`
- [Risk dashboard](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py): `app.py`
- [Product details](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py): `app.py`
- [Executive summary](https://github.com/khushi8602/project-foresight-ai-powered-demand-inventory-intelligence-platform/blob/main/app.py): `app.py`

### Other components

- **Retail user**

## Connections

- Retail source data → Sales cleaning: provides inputs (evidence: `src/01_clean.py`)
- Sales cleaning → Clean sales data: writes cleaned data (evidence: `src/01_clean.py`)
- Clean sales data → Sales exploration: reads sales data (evidence: `src/02_eda.py`)
- Clean sales data → Feature engineering: reads sales data (evidence: `src/03_features.py`)
- Feature engineering → Forecast features: writes features (evidence: `src/03_features.py`)
- Forecast features → Model training: supplies training data (evidence: `src/04_modeling.py`)
- Model training → Saved model assets: saves model assets (evidence: `src/04_modeling.py`)
- Forecast features → Risk scoring: supplies feature data (evidence: `src/05_risk.py`)
- Saved model assets → Risk scoring: loads model assets (evidence: `src/05_risk.py`)
- Inventory and SKU data → Risk scoring: supplies inventory details (evidence: `src/05_risk.py`)
- Risk scoring → Risk results: writes risk scores (evidence: `src/05_risk.py`)
- Retail user → Streamlit dashboard: uses (evidence: `README.md`)
- Streamlit dashboard → Sales analytics: presents sales insights (evidence: `README.md`)
- Streamlit dashboard → Demand forecast: presents demand forecasts (evidence: `README.md`)
- Streamlit dashboard → Inventory monitoring: presents inventory analysis (evidence: `README.md`)
- Streamlit dashboard → Risk dashboard: presents risk analysis (evidence: `README.md`)
- Streamlit dashboard → Product details: presents product details (evidence: `README.md`)
- Streamlit dashboard → Executive summary: presents executive insights (evidence: `README.md`)
- Clean sales data → Streamlit dashboard: loads sales results (evidence: `app.py`)
- Risk results → Streamlit dashboard: loads risk results (evidence: `app.py`)
