# aadii0408/preswald-data-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/aadii0408/preswald-data-analysis
- Repository: https://github.com/aadii0408/preswald-data-analysis

## Overview

##### Project type and purpose
- This is a data-visualization dashboard application (“Education Cost Analysis Dashboard”) built in Python.
- It ingests CSV datasets, processes them with Pandas, and renders interactive charts & maps in the browser using Plotly Express and a Maplibre-based choropleth.
- The app is served via the Preswald App Framework as a web service.

##### File structure
- Top-level files:
- pyproject.toml & preswald.toml – build/deployment & framework configuration
- secrets.toml – runtime credentials (e.g., API keys)
- hello.py – likely the main entry-point routing requests to handlers
- README.md – project overview
- .gitignore – ignored files
- Directories:
- data/ – raw CSV datasets (International_Education_Costs.csv, my_dataset.csv, sample.csv)
- images/ – static assets for the UI
- No separate “frontend” or “backend” folders—frontend is generated server-side by Preswald handlers.

##### README for additional insights
- Core tech stack:
- Preswald App Framework (web server + routing + templating)
- Pandas for ETL and cost computations
- Plotly Express for chart creation
- Maplibre styling for dark themed map visualizations
- Live production URL provided, implying a hosting layer.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Client["Browser (UI)"]:::client
    Client -->|"HTTP Request"| Server

    %% Server Layer
    Server["Preswald Web Server"]:::service
    Server -->|reads config| PreswaldConfig
    Server -->|loads data| DataStore
    Server -->|processes data| Processing
    Server -->|renders visuals| Visualization
    Server -->|serves static assets| StaticAssets
    Server -->|"HTTP Response"| Client

    %% Configuration Layer
    subgraph "Configuration Layer"
        PreswaldConfig["preswald.toml"]:::config
        Secrets["secrets.toml"]:::config
        Packaging["pyproject.toml"]:::config
    end
    PreswaldConfig ---|part of| Server
    Secrets ---|part of| Server
    Packaging ---|part of| Server

    %% Data Storage Layer
    subgraph "Data Storage (CSV Data Store)"
        DataStore["data/"]:::storage
        IEC["International_Education_Costs.csv"]:::storage
        MyDS["my_dataset.csv"]:::storage
        Sample["sample.csv"]:::storage
        DataStore --> IEC
        DataStore --> MyDS
        DataStore --> Sample
    end

    %% Data Processing Layer
    subgraph "Data Processing Layer"
        Processing["Data Processing (Pandas Reader & Cost Calculator)"]:::processing
    end

    %% Visualization Layer
    subgraph "Visualization Layer"
        Visualization["Visualization (Plotly Express & Maplibre Styler)"]:::viz
    end

    %% Static Assets
    StaticAssets["images/"]:::staticAssets

    %% Documentation & Tools
    subgraph "Documentation & Project Files"
        Readme["README.md"]:::documentation
        GitIgnore[".gitignore"]:::documentation
    end

    %% External Services
    subgraph "External Services"
        MapTiles["Map Tile Service"]:::external
        CDN["CDN"]:::external
    end
    MapTiles -->|tiles| Visualization
    CDN -->|assets| StaticAssets

    %% Click Events
    click Server "https://github.com/aadii0408/preswald-data-analysis/blob/main/hello.py"
    click Processing "https://github.com/aadii0408/preswald-data-analysis/blob/main/hello.py"
    click Visualization "https://github.com/aadii0408/preswald-data-analysis/blob/main/hello.py"
    click PreswaldConfig "https://github.com/aadii0408/preswald-data-analysis/blob/main/preswald.toml"
    click Secrets "https://github.com/aadii0408/preswald-data-analysis/blob/main/secrets.toml"
    click Packaging "https://github.com/aadii0408/preswald-data-analysis/blob/main/pyproject.toml"
    click DataStore "https://github.com/aadii0408/preswald-data-analysis/tree/main/data/"
    click IEC "https://github.com/aadii0408/preswald-data-analysis/blob/main/data/International_Education_Costs.csv"
    click MyDS "https://github.com/aadii0408/preswald-data-analysis/blob/main/data/my_dataset.csv"
    click Sample "https://github.com/aadii0408/preswald-data-analysis/blob/main/data/sample.csv"
    click StaticAssets "https://github.com/aadii0408/preswald-data-analysis/tree/main/images/"
    click Readme "https://github.com/aadii0408/preswald-data-analysis/blob/main/README.md"
    click GitIgnore "https://github.com/aadii0408/preswald-data-analysis/blob/main/.gitignore"

    %% Styles
    classDef client fill:#D5E8D4,stroke:#82B366,stroke-width:2px;
    classDef service fill:#DAE8FC,stroke:#6C8EBF,stroke-width:2px;
    classDef config fill:#FFF2CC,stroke:#D6B656,stroke-width:2px;
    classDef storage fill:#FFE6CC,stroke:#D97B0D,stroke-width:2px;
    classDef processing fill:#F8CECC,stroke:#B85450,stroke-width:2px;
    classDef viz fill:#E1D5E7,stroke:#9673A6,stroke-width:2px;
    classDef staticAssets fill:#F5F5F5,stroke:#A8A8A8,stroke-width:2px;
    classDef documentation fill:#F0F0F0,stroke:#B0B0B0,stroke-width:2px;
    classDef external fill:#E0F7FA,stroke:#00838F,stroke-width:2px;
```
