# arpit9516/data-visualization-project architecture

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

- Interactive diagram: https://gitdiagram.com/arpit9516/data-visualization-project
- Repository: https://github.com/arpit9516/data-visualization-project

## Overview

<explanation>
1. Project Type and Purpose
   - This is a full‑stack, no‑code AutoML platform built on Streamlit. It guides users through the end‑to‑end ML workflow—from data ingestion through model deployment as a REST API (via FastAPI). The UI is in Streamlit (`app.py` + `pages/`), the core pipeline logic lives in `utils/`, and models get stored/deployed.

2. High‑Level Architecture Components
   a. User Interface (Frontend)
      • Streamlit Web App (app.py + pages/01_…/09)
      • Renders forms, charts, tables; captures user inputs and triggers pipeline steps.
   b. Core Pipeline (Backend)
      • `utils/` modules implementing each step: data_loader, data_cleaner, data_profiler, data_visualizer, feature_engineering, model_selection, model_training, model_evaluation, model_explanation, model_deployment.
      • Orchestrated by Streamlit callbacks in each page.
   c. Data Storage
      • Uploaded datasets (CSV/Excel) stored in ephemeral memory or temporary folder.
      • Persisted models stored under a models/ or deployed_models/ directory (according to README).
   d. Model Serving
      • FastAPI service spun up by `utils/model_deployment.py` that exposes the trained model as REST endpoints.
      • Automatic OpenAPI docs for the deployed model.
   e. Third‑Party Libraries/Services
      • SHAP or LIME for explainability (model_explanation).
      • Plotting libraries (e.g., Plotly, Matplotlib) for visualization.
      • Hyperparameter search frameworks (e.g., scikit‑optimize, Optuna) under model_selection.

3. Relationships and Data Flows
   - User Browser → Streamlit App: requests pages, submits data
   - Streamlit App → utils/data_loader: uploads & reads data
   - Data flows sequentially through cleaner → profiler → visualizer → feature_engineering → model_selection → model_training → evaluation → explanation.
   - Metadata/results (charts, tables, metrics) flow back to UI for display.
   - Final trained model → utils/model_deployment → FastAPI server → external clients.

4. Key Architectural Patterns
   - Layered MVC‑like structure:
      • View: Streamlit pages
      • Controller/Orchestration: app.py + page scripts
      • Model/Business Logic: utils/ modules
   - Pipeline pattern: each `pages/0X_…` step triggers a corresponding `utils/` function.
   - Microservice for model serving (FastAPI).

5. Diagram Guidelines
   a. Components to Draw
      • “User Browser” icon  
      • “Streamlit Frontend” box containing sub‑boxes: Data Ingestion, Data Pre‑Processing, Visualization, Profiling, Cleaning, Feature Engineering, Model Selection, Model Training, Model Evaluation, Model Explanation, Model Deployment (one box per page)
      • “Core Logic” box (utils/) with arrows from each page to its corresponding utility module
      • “Data Storage” cylinder for uploaded datasets and persisted models
      • “FastAPI Model Service” box for deployed REST API
      • “Third‑Party Libraries” boundary showing SHAP, LIME, plotting libs
   b. Interactions & Data Flow
      • Directional arrows:
         – Browser → Streamlit (HTTP GET/POST)
         – Streamlit → utils modules (function calls)
         – utils → Data Storage (read/write)
         – utils/model_deployment → FastAPI (spawn service & write model artifacts)
         – Clients → FastAPI (prediction requests)
      • Label arrows with action names (e.g., “upload data”, “train model”, “GET /predict”)
   c. Color Coding & Shapes
      • Frontend (Streamlit) in one color (e.g., blue)
      • Backend Utils modules in another (e.g., green)
      • Data Storage in cylinder (orange)
      • External Services/Libs in dashed border (gray)
      • FastAPI service in a separate color (e.g., purple)
   d. Additional Details
      • Show sequence: pages 01 → pages 09 in pipeline order (left to right or top to bottom)
      • Indicate that each page imports and calls a corresponding `utils/` module
      • Annotate model metrics flow back to the UI

6. Tailoring to This Project
   - Emphasize one‑to‑one mapping between `pages/0X_*` and `utils/*.py`.
   - Highlight that the “Model Deployment” step does double duty: saves the model and launches a FastAPI microservice.
   - Note that storage is file‑based (no external database); show local storage icons.
   - Since it’s no‑code, the UI is central—draw it prominently and link every pipeline step to it.

7. Best Practices
   - Use clear, descriptive labels for each component and arrow.
   - Group related pages or utils under a common “ML Workflow” container.
   - Use directional arrows to show data flow; annotate arrow with method or data type (e.g., DataFrame, JSON).
   - Apply color coding consistently so frontend, backend logic, storage, and external services are instantly distinguishable.
   - If using tools like draw.io or Lucidchart, use swimlanes or layered views to separate UI vs. processing vs. serving.
   - Keep the diagram uncluttered: group minor modules but show explicit connections for critical data paths.

By following these guidelines, you’ll produce a detailed, accurate system design diagram that captures the end‑to‑end architecture of the AutoML Streamlit platform—including UI, core logic, storage, and deployed model service.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["User Browser"]:::external

    subgraph "Streamlit Frontend"
        direction TB
        FE_App["Main App (app.py)"]:::frontend
        FE_Page1["01_Data_Ingestion"]:::frontend
        FE_Page1_5["01_5_Pre_Processing_Data"]:::frontend
        FE_Page2["02_Data_Profiling"]:::frontend
        FE_Page2_5["02_5_Data_Visualization"]:::frontend
        FE_Page3["03_Data_Cleaning"]:::frontend
        FE_Page4["04_Feature_Engineering"]:::frontend
        FE_Page5["05_Model_Selection"]:::frontend
        FE_Page6["06_Model_Training"]:::frontend
        FE_Page7["07_Model_Evaluation"]:::frontend
        FE_Page8["08_Model_Explanation"]:::frontend
        FE_Page9["09_Model_Deployment"]:::frontend
    end

    subgraph "Core Logic (utils)"
        direction TB
        UL1["data_loader.py"]:::backend
        UL2["data_visualizer.py"]:::backend
        UL3["data_profiler.py"]:::backend
        UL4["data_cleaner.py"]:::backend
        UL5["feature_engineering.py"]:::backend
        UL6["model_selection.py"]:::backend
        UL7["model_training.py"]:::backend
        UL8["model_evaluation.py"]:::backend
        UL9["model_explanation.py"]:::backend
        UL10["model_deployment.py"]:::backend
    end

    DS["Data Storage"]:::storage
    FS["FastAPI Model Service"]:::service

    subgraph "Third-Party Libraries" 
        direction TB
        EX1["SHAP / LIME"]:::external
        EX2["Plotly / Matplotlib"]:::external
        EX3["Optuna / scikit-optimize"]:::external
    end

    A -->|"HTTP GET/POST"| FE_App
    FE_App --> FE_Page1
    FE_Page1 -->|calls load_data| UL1
    FE_Page1_5 -->|calls visualize_preprocessing| UL2
    FE_Page2 -->|calls profile_data| UL3
    FE_Page2_5 -->|calls visualize_data| UL2
    FE_Page3 -->|calls clean_data| UL4
    FE_Page4 -->|calls engineer_features| UL5
    FE_Page5 -->|calls select_model| UL6
    FE_Page6 -->|calls train_model| UL7
    FE_Page7 -->|calls evaluate_model| UL8
    FE_Page8 -->|calls explain_model| UL9
    FE_Page9 -->|calls deploy_model| UL10

    UL1 -->|read/write DataFrame| DS
    UL2 -->|read/write DataFrame| DS
    UL3 -->|read DataFrame| DS
    UL4 -->|write DataFrame| DS
    UL5 -->|read/write DataFrame| DS
    UL6 -->|read DataFrame| DS
    UL7 -->|write model artifact| DS
    UL8 -->|read metrics| DS
    UL9 -->|read model| DS
    UL10 -->|save model & start service| DS
    UL10 -->|launch| FS

    Client["External Client"]:::external
    Client -->|"GET /predict"| FS

    FE_Page8 --> EX1
    FE_Page2_5 --> EX2
    FE_Page5 --> EX3

    classDef frontend fill:#D6EAF8,stroke:#1B4F72
    classDef backend fill:#D5F5E3,stroke:#145A32
    classDef storage fill:#FAD7A0,stroke:#B9770E,stroke-width:2px
    classDef service fill:#EBDEF0,stroke:#6C3483
    classDef external fill:#F2F3F4,stroke-dasharray: 5 5

    click FE_App "https://github.com/arpit9516/data-visualization-project/blob/main/app.py"
    click FE_Page1 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/01_Data_Ingestion.py"
    click FE_Page1_5 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/01_5_Pre_Processing_Data.py"
    click FE_Page2 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/02_Data_Profiling.py"
    click FE_Page2_5 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/02_5_Data_Visualization.py"
    click FE_Page3 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/03_Data_Cleaning.py"
    click FE_Page4 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/04_Feature_Engineering.py"
    click FE_Page5 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/05_Model_Selection.py"
    click FE_Page6 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/06_Model_Training.py"
    click FE_Page7 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/07_Model_Evaluation.py"
    click FE_Page8 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/08_Model_Explanation.py"
    click FE_Page9 "https://github.com/arpit9516/data-visualization-project/blob/main/pages/09_Model_Deployment.py"
    click UL1 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/data_loader.py"
    click UL2 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/data_visualizer.py"
    click UL3 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/data_profiler.py"
    click UL4 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/data_cleaner.py"
    click UL5 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/feature_engineering.py"
    click UL6 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/model_selection.py"
    click UL7 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/model_training.py"
    click UL8 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/model_evaluation.py"
    click UL9 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/model_explanation.py"
    click UL10 "https://github.com/arpit9516/data-visualization-project/blob/main/utils/model_deployment.py"
    click DS "https://github.com/arpit9516/data-visualization-project/tree/main/models/"
    click Client "https://github.com/arpit9516/data-visualization-project/blob/main/README.md"
    click Client "https://github.com/arpit9516/data-visualization-project/blob/main/pyproject.toml"
```
