# shriyansh24/info_viz_iterration architecture

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

- Interactive diagram: https://gitdiagram.com/shriyansh24/info_viz_iterration
- Repository: https://github.com/shriyansh24/info_viz_iterration

## Overview

##### Project Type & Purpose
- This is a self‑contained Python “full‐stack” dashboard application built with Streamlit.

##### High‐Level Architecture Components
- User Interface (Streamlit)
- Application Orchestrator (app.py)
- UI Sections (components/overview.py, insights.py, prediction.py)
- Data Layer
- Input files (attached_assets/*.csv, .xlsx)
- Data processing scripts (data_processor.py + utils/*.py)
- Model Layer
- Trainer (models/trainer.py)
- Predictor (models/predictor.py)
- External Services & Libraries
- Streamlit framework
- Pandas, NumPy (data manipulation)
- Scikit‑learn (machine learning)
- Plotly (visualization)
- OpenpyXL (Excel I/O)

##### Relationships & Data Flow
- Browser ⟶ Streamlit Frontend (app.py renders pages)
- Frontend calls Data Layer for ingestion/validation
- Processed data ⟶ ML Predictor for on‑the‑fly predictions
- Optionally, processed data ⟶ ML Trainer for batch retraining
- Model outputs & metrics ⟶ UI Sections for visualization & recommendations
- Model performance metrics logged back for Model Monitoring

##### Architectural Patterns & Principles
- Layered architecture:
- Presentation (Streamlit UI)
- Application (app.py controller)
- Domain (data processing & ML modules)
- Data (file storage)
- Modularization: each major feature (overview, prediction, insights) lives under components/
- Separation of concerns: data_utils vs. model_utils vs. UI components

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        Browser["Browser"]:::ui
        Streamlit["Streamlit Server"]:::ui
        subgraph "components/"
            Overview["overview.py"]:::ui
            Insights["insights.py"]:::ui
            Prediction["prediction.py"]:::ui
        end
    end

    %% Application Orchestrator
    Orchestrator["App Orchestrator\n(app.py)"]:::controller

    %% Data Layer
    subgraph "Data Layer"
        Attached["attached_assets/"]:::storage
        DataProc["data_processor.py"]:::data
        subgraph "data_utils/"
            DPUtil["data_processor.py"]:::data
            QA["data_quality.py"]:::data
            Quick["quick_insights.py"]:::data
        end
        subgraph "visualization_utils/"
            VizUtil["visualization.py"]:::ext
            Theme["theme.py"]:::ext
        end
        subgraph "monitoring_utils/"
            MonitorUtil["model_monitoring.py"]:::ext
            MetricsUtil["model_metrics.py"]:::ext
        end
    end

    %% Model Layer
    subgraph "Model Layer"
        Trainer["trainer.py"]:::model
        Predictor["predictor.py"]:::model
    end

    %% External Libraries
    subgraph "External Libraries"
        Pandas["Pandas"]:::ext
        NumPy["NumPy"]:::ext
        Sklearn["Scikit-learn"]:::ext
        Plotly["Plotly"]:::ext
        OpenpyXL["OpenpyXL"]:::ext
    end

    %% Connections
    Browser -->|"HTTP Request"| Streamlit
    Streamlit -->|"control"| Orchestrator
    Streamlit -->|"renders"| Overview
    Streamlit -->|"renders"| Insights
    Streamlit -->|"renders"| Prediction

    Orchestrator -->|"load raw files"| Attached
    Orchestrator -->|"invoke ingestion"| DataProc

    DataProc -->|"uses"| DPUtil
    DataProc -->|"uses"| QA
    DataProc -->|"uses"| Quick
    DataProc -->|"calls"| VizUtil
    DataProc -->|"calls"| Theme

    DataProc -->|"clean DataFrame"| Predictor
    DataProc -.->|"batch data"| Trainer

    Predictor -->|"predictions"| Orchestrator
    Trainer -.->|"retrained model"| Orchestrator

    Predictor -->|"log metrics"| MetricsUtil
    Trainer -->|"log metrics"| MonitorUtil

    Orchestrator -->|"display results"| Streamlit

    %% External Libraries usage
    DataProc --> Pandas
    DataProc --> NumPy
    Trainer --> Sklearn
    Predictor --> Sklearn
    Streamlit --> Plotly
    DataProc --> OpenpyXL

    %% Click Events
    click Orchestrator "https://github.com/shriyansh24/info_viz_iterration/blob/main/app.py"
    click Overview "https://github.com/shriyansh24/info_viz_iterration/blob/main/components/overview.py"
    click Insights "https://github.com/shriyansh24/info_viz_iterration/blob/main/components/insights.py"
    click Prediction "https://github.com/shriyansh24/info_viz_iterration/blob/main/components/prediction.py"
    click DataProc "https://github.com/shriyansh24/info_viz_iterration/blob/main/data_processor.py"
    click DPUtil "https://github.com/shriyansh24/info_viz_iterration/blob/main/utils/data_processor.py"
    click QA "https://github.com/shriyansh24/info_viz_iterration/blob/main/utils/data_quality.py"
    click Quick "https://github.com/shriyansh24/info_viz_iterration/blob/main/utils/quick_insights.py"
    click VizUtil "https://github.com/shriyansh24/info_viz_iterration/blob/main/utils/visualization.py"
    click Theme "https://github.com/shriyansh24/info_viz_iterration/blob/main/utils/theme.py"
    click MonitorUtil "https://github.com/shriyansh24/info_viz_iterration/blob/main/utils/model_monitoring.py"
    click MetricsUtil "https://github.com/shriyansh24/info_viz_iterration/blob/main/utils/model_metrics.py"
    click Attached "https://github.com/shriyansh24/info_viz_iterration/tree/main/attached_assets/"
    click Trainer "https://github.com/shriyansh24/info_viz_iterration/blob/main/models/trainer.py"
    click Predictor "https://github.com/shriyansh24/info_viz_iterration/blob/main/models/predictor.py"

    %% Styles
    classDef ui fill:#1b9e77,stroke:#000,stroke-width:1px
    classDef data fill:#d95f02,stroke:#000,stroke-width:1px
    classDef model fill:#7570b3,stroke:#000,stroke-width:1px
    classDef storage fill:#666666,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5
    classDef ext fill:#66c2a5,stroke:#000,stroke-width:1px,stroke-dasharray: 2 2
    classDef controller fill:#377eb8,stroke:#000,stroke-width:1px

    %% Legend
    subgraph Legend
        LUI["UI Layer"]:::ui
        LData["Data Layer"]:::data
        LModel["Model Layer"]:::model
        LStorage["Storage"]:::storage
        LExt["External Libs"]:::ext
        LCtrl["App Orchestrator"]:::controller
    end
```
