# tripathi-22/cryptocurrency-insights-dashboard architecture

> Architecture diagram of the GitHub repository tripathi-22/cryptocurrency-insights-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tripathi-22/cryptocurrency-insights-dashboard
- Repository: https://github.com/tripathi-22/cryptocurrency-insights-dashboard

## Overview

##### Project type and purpose
- This is a data‐analytics & BI pipeline rather than a traditional web application. It ingests raw crypto CSVs, performs ETL and machine learning in Python, loads results into a MySQL database, and finally builds an interactive Power BI dashboard.

##### File structure
- Top‐level files:
- README.md — project overview and instructions
- final.pbix — Power BI dashboard file
- merged_data.csv — consolidated dataset output from ETL
- python.py — main ETL + ML + database integration script
- python_visualization (directory) — likely holds Python‐generated plots or notebooks
- No frontend/backend folders per se; instead you have an ETL/ML component and a BI visualization component.

##### Extract key insights from the README
- Four sequential stages:
1. Data Preparation (merge & clean 20+ coin CSVs)
2. Machine Learning (KNN & Decision Tree)
3. MySQL Integration (schema design, data import, SQL views)
4. Power BI Dashboard (interactive visuals, DAX, slicers)
- Tech stack: Python (pandas, seaborn, matplotlib, scikit-learn), MySQL, Power BI.

a. Main components
- Data Sources: original per‐coin CSV files
- ETL & ML Engine: python.py & python_visualization folder
- Storage Layer: MySQL database
- BI Layer: Power BI desktop (final.pbix)
- Users/Consumers: Analysts interacting with the dashboard
b. Relationships & interactions
1. CSV files feed into the ETL script.
2. ETL cleans/merges data and outputs merged_data.csv.
3. Python script trains ML models on merged_data.csv, produces prediction output.
4. Python script connects to MySQL, creates tables & views, and writes both raw and ML results.
5. Power BI connects to MySQL views to build visuals and filters.
6. End users consume the Power BI report.
c. Architectural patterns & principles
- Layered pipeline:
- Ingestion layer (file I/O)
- Processing layer (data cleaning + feature engineering)
- Analytics layer (machine learning)
- Persistence layer (database)
- Presentation layer (dashboard)
- Modular scripts: single python.py orchestrates multiple sub‐tasks
- Separation of concerns: BI layer purely reads from DB, no direct file processing
d. Key technologies/frameworks
- Python (pandas, seaborn, matplotlib) for ETL & visual exploration
- scikit-learn for ML
- mysql-connector-python for DB connectivity
- MySQL engine for storage, indexing, and SQL views
- Power BI for front‐end visualization, DAX, slicers, and themes

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Project Documentation
    README["Project Overview & Instructions"]:::external
    click README "https://github.com/tripathi-22/cryptocurrency-insights-dashboard/blob/main/README.md"

    %% Data Ingestion Layer
    subgraph "Data Ingestion" 
        direction TB
        CSVFiles["Raw Crypto CSV Files"]:::dataIngest
        DataCleaning["Data Cleaning Module"]:::processing
    end
    CSVFiles -->|"reads CSV"| DataCleaning
    DataCleaning -->|"outputs merged_data.csv"| MergedCSV["merged_data.csv"]:::dataIngest
    click DataCleaning "https://github.com/tripathi-22/cryptocurrency-insights-dashboard/blob/main/python.py"
    click MergedCSV "https://github.com/tripathi-22/cryptocurrency-insights-dashboard/blob/main/merged_data.csv"

    %% Processing & Machine Learning Layer
    subgraph "Processing & ML" 
        direction TB
        FeatureEng["Feature Engineering Module"]:::processing
        KNN["KNN Model"]:::processing
        DT["Decision Tree Model"]:::processing
        PythonViz["Python Visualization & Exploratory Plots"]:::processing
    end
    MergedCSV -->|"input CSV"| FeatureEng
    click FeatureEng "https://github.com/tripathi-22/cryptocurrency-insights-dashboard/blob/main/python.py"
    FeatureEng -->|"features"| KNN
    FeatureEng -->|"features"| DT
    KNN -->|"predictions"| MySQLDB
    DT -->|"predictions"| MySQLDB
    FeatureEng -->|"plots output"| PythonViz
    click PythonViz "https://github.com/tripathi-22/cryptocurrency-insights-dashboard/tree/main/python_visualization/"

    %% Storage Layer
    subgraph "Storage Layer" 
        direction TB
        MySQLDB["MySQL Database"]:::storage
        Views["Schema & SQL Views"]:::storage
    end
    MergedCSV -->|"INSERT raw data via mysql-connector-python"| MySQLDB
    KNN -->|"INSERT ML results via mysql-connector-python"| MySQLDB
    DT -->|"INSERT ML results via mysql-connector-python"| MySQLDB
    MySQLDB -->|"exposes views"| Views

    %% Presentation Layer
    subgraph "Presentation & BI" 
        direction TB
        PowerBI["Power BI Dashboard (final.pbix)"]:::presentation
        Users["Analysts / Consumers"]:::external
    end
    Views -->|"SELECT via ODBC/DAX"| PowerBI
    click PowerBI "https://github.com/tripathi-22/cryptocurrency-insights-dashboard/blob/main/final.pbix"
    PowerBI -->|"interactive exploration"| Users

    %% Styles
    classDef dataIngest fill:#AED6F1,stroke:#1F618D,color:#1B2631
    classDef processing fill:#ABEBC6,stroke:#239B56,color:#1B2631
    classDef storage fill:#F5CBA7,stroke:#D35400,color:#1B2631
    classDef presentation fill:#D2B4DE,stroke:#7D3C98,color:#1B2631
    classDef external fill:#E5E7E9,stroke:#566573,color:#1B2631
```
