# pratyushb25/ml-project_dragline_factors architecture

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

- Interactive diagram: https://gitdiagram.com/pratyushb25/ml-project_dragline_factors
- Repository: https://github.com/pratyushb25/ml-project_dragline_factors

## Overview

##### Main Components

a) Frontend Layer:
- React Web Application (webapp directory)
- User interface components
- Main App.js and related static assets

b) Backend Layer:
- Flask API Server (api directory)
- Model Serving Component

c) Model Layer:
- TensorFlow Deep Neural Network Model
- Model Preprocessor
- Saved model artifacts (Dragline_Factors.h5 and preprocessor.joblib)

d) Data Layer:
- Excel Data Sources
- Training/Test Datasets

##### Component Relationships

- User → React Frontend → Flask API → Model
- Data Flow: Input Parameters → Predictions → UI Display
- Model Training Flow: Excel Data → Jupyter Notebook → Saved Model

##### Specific Implementation Details

- Frontend (React):
- User Interface Components
- State Management
- API Integration

- Backend (Flask):
- API Endpoints
- Model Loading
- Prediction Service

- Machine Learning Pipeline:
- Data Preprocessing
- Model Architecture
- Inference Pipeline

##### Technical Specifications

Annotations for:
- Technologies: TensorFlow, Flask, React, Pandas, NumPy
- File Formats: .h5 (model), .xlsx (data), .joblib (preprocessor)
- API Communication Protocols
- Data Transformation Flow

**[User Interface Layer]**
- ↓
**[API Layer]**
- ↓
**[Model Layer]**
- ↓
**[Data Layer]**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User_Interface
        UI[User Interface]
        ReactApp[React Application]:::frontend
        Components[UI Components]:::frontend
        StateManagement[State Management]:::frontend
        APIIntegration[API Integration]:::frontend
    end

    subgraph API_Layer
        FlaskAPI[Flask API Server]:::backend
        Endpoints[API Endpoints]:::backend
        ModelServing[Model Serving]:::backend
    end

    subgraph ML_Pipeline
        MLModel[TensorFlow DNN Model]:::model
        Preprocessor[Model Preprocessor]:::model
        InferencePipeline[Inference Pipeline]:::model
    end

    subgraph Data_Storage
        TrainingData[Training Dataset]:::data
        TestData[Test Dataset]:::data
    end

    subgraph Development
        Notebook[Jupyter Notebook]:::dev
        ModelTraining[Model Training]:::dev
    end

    %% Relationships
    UI --> ReactApp
    ReactApp --> Components
    ReactApp --> StateManagement
    ReactApp --> APIIntegration
    APIIntegration --> FlaskAPI
    FlaskAPI --> Endpoints
    Endpoints --> ModelServing
    ModelServing --> MLModel
    ModelServing --> Preprocessor
    MLModel --> InferencePipeline
    Preprocessor --> InferencePipeline
    TrainingData --> Notebook
    TestData --> Notebook
    Notebook --> ModelTraining
    ModelTraining --> MLModel

    %% Click Events
    click ReactApp "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/webapp/src/App.js"
    click Components "https://github.com/pratyushb25/ML-Project_dragline_factors/tree/master/webapp/build/static/"
    click FlaskAPI "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/api/flask_api.py"
    click MLModel "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/model/Dragline_Factors.h5"
    click Preprocessor "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/model/preprocessor.joblib"
    click TrainingData "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/data/Dragline Factors V1.xlsx"
    click TestData "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/data/DF_test_1.xlsx"
    click Notebook "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/notebook/Dragline_Factors.ipynb"
    click StateManagement "https://github.com/pratyushb25/ML-Project_dragline_factors/blob/master/webapp/src/index.js"
    click UI "https://github.com/pratyushb25/ML-Project_dragline_factors/tree/master/webapp/public/"
    click Components "https://github.com/pratyushb25/ML-Project_dragline_factors/tree/master/webapp/build/"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef model fill:#f1c40f,stroke:#f39c12,color:black
    classDef data fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef dev fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        Frontend[Frontend Component]:::frontend
        Backend[Backend Component]:::backend
        Model[ML Component]:::model
        Data[Data Storage]:::data
        Dev[Development]:::dev
    end
```
