# ankuranks/digital_challenge architecture

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

- Interactive diagram: https://gitdiagram.com/ankuranks/digital_challenge
- Repository: https://github.com/ankuranks/digital_challenge

## Overview

##### Project type and purpose
- This is a data-science challenge repository, not a full-stack web app. It consists of three logical layers:
- Raw data storage (“Data” folder)
- SQL-based data exploration and transformation (“Part 1 SQL”)
- Machine-learning modeling and reporting (“Part 2 ML”)
- The goal is to take raw CSVs, run SQL queries to explore/transform, then build, evaluate, and explain ML models with Jupyter Notebooks, producing SHAP values and Sweetviz reports.

##### File structure
- Top-level:
- Data/ – raw inputs and a PPTX deliverable
- Part 1 SQL/ – three .sql scripts and documentation
- Part 2 ML/ – a Jupyter Notebook, outputs (SHAP_Values.csv, SWEETVIZ_REPORT.html, scores.csv)
- No web server, no microservices: it’s a linear data pipeline.

##### README for additional insights
- Confirms three deliverable sections (Data, SQL, ML)
- No external API integrations or deployment scripts
- Dependencies implicitly: an SQL engine (e.g., SQLite or Postgres), Python libs in the notebook (pandas, scikit-learn, shap, sweetviz)

##### Main components and interactions
a. Components
- Raw Data Store (CSV files in Data/)
- SQL Engine (runs Query1.sql–Query3.sql against raw data)
- Transformed Data (intermediate result sets or derived CSVs)
- ML Environment (Jupyter Notebook in Part 2 ML)
- Model artifacts (trained model, SHAP values)
- Reporting tools (SWEETVIZ_REPORT.html)
b. Data Flow
1. Raw CSVs → SQL Engine
2. SQL Engine → transformed CSVs or database views
3. Transformed data → Jupyter Notebook for training/evaluation
4. Notebook → output artifacts (scores.csv, SHAP_Values.csv, HTML report)
c. Architectural patterns/design principles
- Linear ETL → Train → Report pipeline
- Clear separation of concerns: storage, transformation, modeling, reporting
d. Technologies/frameworks
- SQL (engine unspecified, assume SQLite/Postgres)
- Python/Jupyter (pandas, scikit-learn, shap, sweetviz)
- CSV/HTML as interchange formats

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Project Overview
    ProjectOverview["README.md"]:::overview

    %% Raw Data Store Layer
    subgraph "Raw Data Store" 
        direction TB
        RawDataStore["Raw Data Store\n(CSV files)"]:::data
        RawScores["scores.csv"]:::data
        RawPPTX["Digital Challenge.pptx"]:::data
    end

    %% SQL Transformation Layer
    subgraph "SQL Transformation" 
        direction TB
        SQLEngine["SQL Engine\n(SQLite/Postgres)"]:::sql
        Query1["Query1.sql"]:::sql
        Query2["Query2.sql"]:::sql
        Query3["Query3.sql"]:::sql
        SQLReadMe["ReadMe.md"]:::sql
    end

    %% ML Modeling & Evaluation Layer
    subgraph "ML Modeling & Evaluation"
        direction TB
        MLNotebook["Digital Challenge.ipynb\n(Jupyter Notebook)"]:::ml
        MLReadMe["ReadMe.md"]:::ml
    end

    %% Reporting & Deliverables Layer
    subgraph "Reporting & Deliverables"
        direction TB
        SHAP["SHAP_Values.csv"]:::report
        ScoresOut["scores.csv"]:::report
        Sweetviz["SWEETVIZ_REPORT.html"]:::report
        FinalPPTX["Digital Challenge.pptx"]:::report
    end

    %% Connections
    ProjectOverview --> RawDataStore
    RawDataStore --> SQLEngine
    SQLEngine --> MLNotebook
    MLNotebook --> SHAP
    MLNotebook --> ScoresOut
    MLNotebook --> Sweetviz
    Sweetviz --> FinalPPTX
    RawPPTX --> FinalPPTX

    %% Click Events
    click ProjectOverview "https://github.com/ankuranks/digital_challenge/blob/main/README.md"
    click RawDataStore "https://github.com/ankuranks/digital_challenge/tree/main/Data/"
    click RawScores "https://github.com/ankuranks/digital_challenge/blob/main/Data/scores.csv"
    click RawPPTX "https://github.com/ankuranks/digital_challenge/blob/main/Data/Digital Challenge.pptx"
    click SQLEngine "https://github.com/ankuranks/digital_challenge/tree/main/Part 1 SQL/"
    click Query1 "https://github.com/ankuranks/digital_challenge/blob/main/Part 1 SQL/Query1.sql"
    click Query2 "https://github.com/ankuranks/digital_challenge/blob/main/Part 1 SQL/Query2.sql"
    click Query3 "https://github.com/ankuranks/digital_challenge/blob/main/Part 1 SQL/Query3.sql"
    click SQLReadMe "https://github.com/ankuranks/digital_challenge/blob/main/Part 1 SQL/ReadMe.md"
    click MLNotebook "https://github.com/ankuranks/digital_challenge/blob/main/Part 2 ML/Digital Challenge.ipynb"
    click MLReadMe "https://github.com/ankuranks/digital_challenge/blob/main/Part 2 ML/ReadMe.md"
    click SHAP "https://github.com/ankuranks/digital_challenge/blob/main/Part 2 ML/SHAP_Values.csv"
    click ScoresOut "https://github.com/ankuranks/digital_challenge/blob/main/Part 2 ML/scores.csv"
    click Sweetviz "https://github.com/ankuranks/digital_challenge/blob/main/Part 2 ML/SWEETVIZ_REPORT.html"

    %% Styles
    classDef data fill:#e0f7fa,stroke:#006064,color:#006064
    classDef sql fill:#e3f2fd,stroke:#0d47a1,color:#0d47a1
    classDef ml fill:#fff3e0,stroke:#e65100,color:#e65100
    classDef report fill:#f3e5f5,stroke:#4a148c,color:#4a148c
    classDef overview fill:#eeeeee,stroke:#424242,color:#424242
```
