# mtalhaqadir779/python-flask-data-dashboard architecture

> Architecture diagram of the GitHub repository mtalhaqadir779/python-flask-data-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mtalhaqadir779/python-flask-data-dashboard
- Repository: https://github.com/mtalhaqadir779/python-flask-data-dashboard

## Overview

##### Project type and purpose
- This is a simple full-stack data dashboard built with Python Flask (backend) and Bootstrap/HTML (frontend) that visualizes World Bank development indicators using Plotly and Pandas.
- Key deliverable: interactive web dashboard showing charts for arable land, forest area, rural population, etc., pulled from CSV files.

##### File structure
- Top-level files:
- worldbank.py – the Flask app entry point
- requirements.txt – lists Flask, Pandas, Plotly, etc.
- data/ – raw CSV files containing indicator data
- wrangling_scripts/ – Python scripts to clean and prepare data
- worldbankapp/ (Flask package):
- routes.py – defines URL endpoints and view functions
- static/ – CSS, JS, images (Bootstrap assets, Plotly JS)
- templates/ – Jinja2 HTML templates (index.html)

##### README for additional insights
- Confirms use of Flask, Bootstrap, Plotly, and Pandas.
- No database; CSV files are the data source.
- Deployment target: Heroku.

##### Elements
- Browser → Flask (HTTP GET)
- Flask → Data Store (pandas read_csv)
- Flask → Wrangle Module (data processing)
- Flask → Template (render) → Browser
- Browser → Plotly JS (render chart)
- Client UI (blue)
- Server logic (green)
- Data store (yellow)
- External/deployment (gray)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client (Blue)"
        Browser["Browser (Client)"]:::client
    end

    subgraph "External (Gray)"
        Heroku["Heroku Platform"]:::external
        Router["Heroku Router / Gunicorn"]:::external
    end

    subgraph "Server (Green)"
        ServerEntry["worldbank.py"]:::server
        Init["__init__.py"]:::server
        Routes["routes.py"]:::server
        Wrangle["wrangle_data.py"]:::server
        Templates["index.html (Jinja2 Template)"]:::server
        subgraph "Static Assets"
            Bootstrap["Bootstrap CSS/JS"]:::static
            PlotlyJS["Plotly JS"]:::static
            Images["Images"]:::static
        end
        Requirements["requirements.txt"]:::server
    end

    subgraph "Data Store (Yellow)"
        AR["arableland.csv"]:::data
        FO["forestarea.csv"]:::data
        PR["percentruralpopulation.csv"]:::data
        RU["ruralpopulation.csv"]:::data
    end

    Heroku -->|routes traffic| Router
    Router -->|"HTTP GET"| ServerEntry
    ServerEntry -->|imports| Init
    ServerEntry -->|calls| Routes
    Routes -->|uses| Wrangle
    Wrangle -->|reads CSV| AR
    Wrangle -->|reads CSV| FO
    Wrangle -->|reads CSV| PR
    Wrangle -->|reads CSV| RU
    Routes -->|reads CSV| AR
    Routes -->|reads CSV| FO
    Routes -->|reads CSV| PR
    Routes -->|reads CSV| RU
    Routes -->|renders| Templates
    Templates -->|"HTML"| Browser
    Routes -->|serves| Bootstrap
    Routes -->|serves| PlotlyJS
    Routes -->|serves| Images
    Browser -->|loads| Bootstrap
    Browser -->|loads| PlotlyJS
    Browser -->|loads| Images
    Requirements -.->|defines dependencies| ServerEntry

    click ServerEntry "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/worldbank.py"
    click Routes "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/worldbankapp/routes.py"
    click Templates "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/worldbankapp/templates/index.html"
    click Bootstrap "https://github.com/mtalhaqadir779/python-flask-data-dashboard/tree/main/worldbankapp/static/"
    click PlotlyJS "https://github.com/mtalhaqadir779/python-flask-data-dashboard/tree/main/worldbankapp/static/"
    click Images "https://github.com/mtalhaqadir779/python-flask-data-dashboard/tree/main/worldbankapp/static/"
    click Wrangle "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/wrangling_scripts/wrangle_data.py"
    click AR "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/data/arableland.csv"
    click FO "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/data/forestarea.csv"
    click PR "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/data/percentruralpopulation.csv"
    click RU "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/data/ruralpopulation.csv"
    click Requirements "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/requirements.txt"
    click Init "https://github.com/mtalhaqadir779/python-flask-data-dashboard/blob/main/worldbankapp/__init__.py"

    classDef client fill:#add8e6,stroke:#000,stroke-width:1px;
    classDef server fill:#90ee90,stroke:#000,stroke-width:1px;
    classDef data fill:#ffff99,stroke:#000,stroke-width:1px;
    classDef external fill:#d3d3d3,stroke:#000,stroke-width:1px;
    classDef static fill:#ffcccb,stroke:#000,stroke-width:1px;
```
