# rameshwarnaik013/farmley-forecast-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/rameshwarnaik013/farmley-forecast-dashboard
- Repository: https://github.com/rameshwarnaik013/farmley-forecast-dashboard

## Overview

This is a Flask sales-forecasting web app: users upload an Excel workbook, choose groups, items, metrics, and forecasting methods, then review forecasts and backtest accuracy; the app also builds forecast workbooks. Forecast methods live in a separate module. The sampled source supports the upload, forecast, and workbook flows, but does not expose every route or the full dashboard behavior, so those details are kept high-level.

Main entry points: [`api/index.py`](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py) (Forecast run), [`forecasting.py`](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/forecasting.py) (Forecast methods)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask_app["Flask app<br/>[index.py]"]
  node_upload["Excel upload<br/>[index.py]"]
  node_selection["Forecast selection<br/>[index.py]"]
  node_cached_data[("Session data cache<br/>[index.py]")]
end

subgraph group_forecasting["Forecasting"]
  node_forecast_run["Forecast run<br/>[index.py]"]
  node_forecast_methods["Forecast methods<br/>[forecasting.py]"]
  node_backtest["Backtest accuracy<br/>[index.py]"]
end

subgraph group_outputs["Results and export"]
  node_dashboard["Forecast dashboard<br/>[index.py]"]
  node_workbook["Excel workbook output<br/>[index.py]"]
end

node_user(("User"))

node_user -->|"uploads workbook"| node_upload
node_flask_app -->|"routes upload"| node_upload
node_upload -->|"stores parsed data"| node_cached_data
node_selection -->|"reads cached data"| node_cached_data
node_selection -->|"starts forecast"| node_forecast_run
node_forecast_run -->|"calls selected methods"| node_forecast_methods
node_forecast_run -->|"computes accuracy"| node_backtest
node_forecast_run -->|"renders forecasts"| node_dashboard
node_workbook -->|"calls methods"| node_forecast_methods
node_user -.->|"views results"| node_dashboard

click node_flask_app "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py"
click node_upload "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py"
click node_selection "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py"
click node_cached_data "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py"
click node_forecast_run "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py"
click node_forecast_methods "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/forecasting.py"
click node_backtest "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py"
click node_dashboard "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py"
click node_workbook "https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.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_flask_app,node_upload,node_selection,node_cached_data,node_user toneBlue
class node_forecast_run,node_forecast_methods,node_backtest toneAmber
class node_dashboard,node_workbook toneMint
```

## Components

### Web application

- [Flask app](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`
- [Excel upload](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`
- [Forecast selection](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`
- [Session data cache](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`

### Forecasting

- [Forecast run](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`
- [Forecast methods](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/forecasting.py): `forecasting.py`
- [Backtest accuracy](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`

### Results and export

- [Forecast dashboard](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`
- [Excel workbook output](https://github.com/rameshwarnaik013/farmley-forecast-dashboard/blob/main/api/index.py): `api/index.py`

### Other components

- **User**

## Connections

- User → Excel upload: uploads workbook (evidence: `api/index.py`)
- Flask app → Excel upload: routes upload (evidence: `api/index.py`)
- Excel upload → Session data cache: stores parsed data (evidence: `api/index.py`)
- Forecast selection → Session data cache: reads cached data (evidence: `api/index.py`)
- Forecast selection → Forecast run: starts forecast (evidence: `api/index.py`)
- Forecast run → Forecast methods: calls selected methods (evidence: `api/index.py`)
- Forecast run → Backtest accuracy: computes accuracy (evidence: `api/index.py`)
- Forecast run → Forecast dashboard: renders forecasts (evidence: `api/index.py`)
- Excel workbook output → Forecast methods: calls methods (evidence: `api/index.py`)
- User → Forecast dashboard: views results
