# otniel113/visdat_hdi architecture

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

- Interactive diagram: https://gitdiagram.com/otniel113/visdat_hdi
- Repository: https://github.com/otniel113/visdat_hdi

## Overview

##### Project type and purpose
- This is a single‐page, monolithic data-visualization web application.
- Purpose: load an Excel dataset of HDI values, render interactive charts with Bokeh, and serve them via a web server on Heroku.

##### File structure
- Top level:
- Procfile – instructs Heroku how to launch the app (e.g. `web: gunicorn myapp:app`)
- README.md – describes the app’s goal and deployment URL
- myapp.py – Python script that (a) loads the data, (b) builds a Bokeh application, (c) serves HTTP endpoints.
- requirements.txt – Python dependencies (Bokeh, Pandas, openpyxl, Gunicorn, etc.)
- data/HDI.xlsx – source dataset, loaded by myapp.py at runtime.

##### Extract insights from the README
- Interactive visualization using Bokeh.
- Deployed on Heroku.
- Dataset origin and presentation/demo links.

a. Client Browser
b. Heroku Platform:
- Heroku Router (HTTPS endpoint)
- Dyno running the Web Process
c. Web Process inside Dyno:
- Gunicorn (WSGI server)
- Python Bokeh Application (myapp.py)
d. Data Store:
- Local file system in the dyno containing HDI.xlsx
e. External Services:
- Heroku Git (code pushes)
- GlobalDataLab (original dataset source – optional reference)

##### Relationships and interactions
- Browser → HTTPS request → Heroku Router → Dyno (Gunicorn/Bokeh)
- Bokeh app loads HDI.xlsx via Pandas/openpyxl when serving pages or on startup
- Bokeh server generates JSON/JS plots → HTTP response → Browser renders interactive charts
- Git push → Heroku Git → build environment installs requirements.txt → runs Procfile to launch Gunicorn

##### Architectural patterns and design principles
- Monolithic MVC‐style: Bokeh server handles “View” and “Controller” in one process; simple data model loaded from an Excel file.
- Separation of concerns:
- Presentation & interaction: Bokeh in the browser
- Business logic & data access: myapp.py + Pandas
- Deployment & process management: Gunicorn + Procfile on Heroku

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client"
        Browser["Client Browser"]:::external
    end

    subgraph "Heroku Platform"
        Router["Heroku Router (HTTPS)"]:::platform
        subgraph "Dyno (Web Process)"
            Gin["Gunicorn WSGI Server"]:::compute
            App["Bokeh App (myapp.py)"]:::compute
            Data["HDI.xlsx"]:::data
        end
    end

    HerokuGit["Heroku Git"]:::platform
    Build["Build Environment"]:::platform
    Req["requirements.txt"]:::platform
    Proc["Procfile"]:::platform
    Doc["README.md"]:::platform

    Browser -->|"HTTPS Request"| Router
    Router -->|"forwards request"| Gin
    Gin -->|"WSGI Interface"| App
    App -->|"loads data via Pandas/openpyxl"| Data
    App -->|"generates JSON/JS plots"| Gin
    Gin -->|"HTTP Response"| Router
    Router -->|"renders charts"| Browser

    HerokuGit -->|"git push"| Build
    Build -->|"installs deps from"| Req
    Build -->|"runs Procfile"| Proc
    Proc -->|"launches"| Gin

    Doc -.->|"\u2022 docs for deployment"| Build

    click Proc "https://github.com/otniel113/visdat_hdi/tree/main/Procfile"
    click App "https://github.com/otniel113/visdat_hdi/blob/main/myapp.py"
    click Data "https://github.com/otniel113/visdat_hdi/blob/main/data/HDI.xlsx"
    click Req "https://github.com/otniel113/visdat_hdi/blob/main/requirements.txt"
    click Doc "https://github.com/otniel113/visdat_hdi/blob/main/README.md"

    classDef compute fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef data fill:#90EE90,stroke:#000,stroke-width:1px
    classDef platform fill:#FFA500,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
