# mrstarkng/graphora architecture

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

- Interactive diagram: https://gitdiagram.com/mrstarkng/graphora
- Repository: https://github.com/mrstarkng/graphora

## Overview

##### Project Type and Purpose
- Graphora is a full-stack, interactive data visualization dashboard built with Streamlit.
- Its goal is to let users explore and analyze Vietnam’s educational data (multiple school levels, regions, years) and ask questions via an AI assistant.

##### File Structure
- Top-level entry point: Home.py (Streamlit app launcher).
- pages/: Four Streamlit subpages (Data Wrangling, EDA, Dashboard, AI Assistant).
- data/: CSV files (flat-file “database”).
- .streamlit/: UI configuration (menu, theming).
- Dockerfile & fly.toml: Containerization and Fly.io deployment.
- GitHub Actions CI: .github/workflows/fly-deploy.yml.
- pyproject.toml & uv.lock: Dependency management (UV).
- .env: API keys (Gemini AI).

##### README for Additional Insights
- Stack: Python, Streamlit, Pandas, Plotly Express, Google Gemini API, UV, Docker, Fly.io.
- Features align with pages/ modules.
- Deployment and environment instructions confirm the runtime platform.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User & UI Layer
    subgraph "User & UI"
        U["User"]:::user
        UI["Streamlit UI"]:::ui
        HW["Home.py"]:::ui
        DW_pg["Data Wrangling"]:::ui
        EDA_pg["EDA"]:::ui
        DB_pg["Dashboard"]:::ui
        AI_pg["AI Assistant"]:::ui
    end

    %% Application Logic & Processing
    subgraph "Application Logic & Processing"
        DWc["pages/1_Data_Wrangling.py"]:::logic
        EDAp["pages/2_EDA.py"]:::logic
        DBp["pages/3_Dashboard.py"]:::logic
        AIp["pages/4_AI_Assistant.py"]:::logic
    end

    %% Data Layer
    subgraph "Data Layer"
        C1["THCS.csv"]:::data
        C2["THPT.csv"]:::data
        C3["tieu-hoc.csv"]:::data
        C4["MG.csv"]:::data
        C5["tong-quan-MG.csv"]:::data
        C6["chi-so-phat-trien.csv"]:::data
        C7["tong-quan-all.csv"]:::data
        C8["tong-quan.csv"]:::data
    end

    %% AI Service & Environment
    subgraph "AI Service & Environment"
        AIAPI["Google Gemini API"]:::external
        ENV[".env"]:::config
        CONF[".streamlit/config.toml"]:::config
        TP["pyproject.toml"]:::config
        LOCK["uv.lock"]:::config
    end

    %% Deployment & CI/CD
    subgraph "Deployment & CI/CD"
        D["Dockerfile"]:::infra
        DI[".dockerignore"]:::infra
        FT["fly.toml"]:::infra
        CI["fly-deploy.yml"]:::infra
    end

    %% Connections
    U --> UI
    UI --> HW
    UI --> DW_pg
    UI --> EDA_pg
    UI --> DB_pg
    UI --> AI_pg

    HW --> DWc
    DW_pg --> DWc
    EDA_pg --> EDAp
    DB_pg --> DBp
    AI_pg --> AIp

    DWc --> C1
    DWc --> C2
    DWc --> C3
    DWc --> C4
    EDAp --> C5
    EDAp --> C6
    DBp --> C7
    DBp --> C8

    AIp --> AIAPI

    ENV --> UI
    ENV --> AIp
    CONF --> UI
    TP --> DWc
    LOCK --> DWc

    CI --> D
    CI --> DI
    CI --> FT

    %% Click events
    click HW "https://github.com/mrstarkng/graphora/blob/main/Home.py"
    click DWc "https://github.com/mrstarkng/graphora/blob/main/pages/1_Data_Wrangling.py"
    click EDAp "https://github.com/mrstarkng/graphora/blob/main/pages/2_EDA.py"
    click DBp "https://github.com/mrstarkng/graphora/blob/main/pages/3_Dashboard.py"
    click AIp "https://github.com/mrstarkng/graphora/blob/main/pages/4_AI_Assistant.py"
    click C1 "https://github.com/mrstarkng/graphora/blob/main/data/dia-phuong/THCS.csv"
    click C2 "https://github.com/mrstarkng/graphora/blob/main/data/dia-phuong/THPT.csv"
    click C3 "https://github.com/mrstarkng/graphora/blob/main/data/dia-phuong/tieu-hoc.csv"
    click C4 "https://github.com/mrstarkng/graphora/blob/main/data/mau-giao/MG.csv"
    click C5 "https://github.com/mrstarkng/graphora/blob/main/data/mau-giao/tong-quan-MG.csv"
    click C6 "https://github.com/mrstarkng/graphora/blob/main/data/tong-quan/chi-so-phat-trien.csv"
    click C7 "https://github.com/mrstarkng/graphora/blob/main/data/tong-quan/tong-quan-all.csv"
    click C8 "https://github.com/mrstarkng/graphora/blob/main/data/tong-quan/tong-quan.csv"
    click ENV "https://github.com/mrstarkng/graphora/blob/main/.env"
    click CONF "https://github.com/mrstarkng/graphora/blob/main/.streamlit/config.toml"
    click TP "https://github.com/mrstarkng/graphora/blob/main/pyproject.toml"
    click LOCK "https://github.com/mrstarkng/graphora/blob/main/uv.lock"
    click D "https://github.com/mrstarkng/graphora/tree/main/Dockerfile"
    click DI "https://github.com/mrstarkng/graphora/blob/main/.dockerignore"
    click FT "https://github.com/mrstarkng/graphora/blob/main/fly.toml"
    click CI "https://github.com/mrstarkng/graphora/blob/main/.github/workflows/fly-deploy.yml"

    %% Styles
    classDef user fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef logic fill:#87CEFA,stroke:#333,stroke-width:1px
    classDef data fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
    classDef config fill:#FFFF99,stroke:#333,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px
```
