# romainpen/end_to_end_project_example architecture

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

- Interactive diagram: https://gitdiagram.com/romainpen/end_to_end_project_example
- Repository: https://github.com/romainpen/end_to_end_project_example

## Overview

##### Project type and purpose
- This is a full-stack, end-to-end machine-learning web application for diabetes prediction.
- The backend is a Python web service (likely Flask or FastAPI) that loads a pre-trained model and scaler, exposes an API, and handles data processing.
- The frontend is a server-rendered HTML/JS/CSS layer with templates for user interaction.
- CI/CD, containerization, and deployment support are provided via GitHub Actions, Dockerfile, and Procfile.

##### File structure
Top level:
- Dockerfile, Procfile – container build and platform deployment descriptors
- .github/workflows/main.yaml – CI pipeline for building/testing/deploying
- backend/ – Python service code, configuration, data, model artifacts, notebooks, and tests
- frontend/ – static assets and HTML templates for the UI

backend/ substructure:
- config/settings.yaml – runtime parameters (ports, file paths, thresholds)
- API.py, main.py – service entry points and route definitions
- model/*.pkl – trained logistic regression model and scaler
- data/diabetes.csv – source data used to train the model
- src/data_treatment, src/model, src/data_visualization – implementation of data pipelines, modeling, and EDA modules
- notebook/Diabete_modeling.ipynb – exploratory data analysis and model building workflow
- tests/ – unit or integration tests (currently placeholder)

frontend/ substructure:
- templates/ – Jinja (or similar) HTML templates: base layout, home, new_page
- templates/css – styles.css
- templates/js – script.js
- image/ – static assets

##### README
- Minimal (“End_to_end_project_example”), but combined with the file tree it implies a demo ML-powered web app.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["Client Browser"]:::ui

    subgraph "Frontend Layer"
        Frontend["Frontend Server (HTML/CSS/JS Templates)"]:::ui
    end

    subgraph "Backend Layer"
        AppMain["App Startup (main.py)"]:::backend
        APIRoutes["API Routes (API.py)"]:::backend
        Config["Config & Settings (settings.yaml)"]:::backend
        DataTreat["Data Treatment Module"]:::ml
        ModelBuild["Model Building Code (model_building.py)"]:::ml
        ModelFile["Pre-trained Model (log_reg_model.pkl)"]:::ml
        ScalerFile["Pre-trained Scaler (scaler_model.pkl)"]:::ml
        DataVis["Data Visualization Module (EDA.py)"]:::ml
    end

    subgraph "Data Store"
        CSV["Raw Data (diabetes.csv)"]:::data
        Logs["Logs Directory"]:::data
    end

    subgraph "Offline Pipeline"
        Notebook["Notebook: Diabete_modeling.ipynb"]:::ml
    end

    subgraph "CI/CD & Deployment"
        CICD["CI/CD Pipeline (GitHub Actions)"]:::infra
        Docker["Dockerfile"]:::infra
        Proc["Procfile"]:::infra
    end

    Developer["Developer"]:::infra

    User -->|"submits form"| Frontend
    Frontend -->|"HTTP/JSON"| APIRoutes
    AppMain -->|"initialize routes"| APIRoutes
    AppMain -->|"load config"| Config
    APIRoutes -->|"preprocess"| DataTreat
    APIRoutes -->|"invoke prediction"| ModelFile
    APIRoutes -->|"apply scaling"| ScalerFile
    APIRoutes -->|"log result"| Logs
    APIRoutes -->|"response JSON"| Frontend
    Frontend -->|renders result| User

    Notebook -->|"creates model artifact"| ModelFile
    Notebook -->|"creates scaler artifact"| ScalerFile
    Notebook -->|"run EDA"| DataVis

    Developer -->|"push code"| CICD
    CICD -->|"build image"| Docker
    Docker -->|"deploy image"| Proc
    Proc -->|"start service"| AppMain

    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px
    classDef ml fill:#FFA500,stroke:#333,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef data fill:#FFD700,stroke:#333,stroke-width:1px

    click Frontend "https://github.com/romainpen/end_to_end_project_example/tree/main/frontend/templates/"
    click AppMain "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/main.py"
    click APIRoutes "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/API.py"
    click Config "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/config/settings.yaml"
    click DataTreat "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/src/data_treatment/data_scaling.py"
    click ModelBuild "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/src/model/model_building.py"
    click ModelFile "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/model/log_reg_model.pkl"
    click ScalerFile "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/model/scaler_model.pkl"
    click DataVis "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/src/data_visualization/EDA.py"
    click CSV "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/data/diabetes.csv"
    click Logs "https://github.com/romainpen/end_to_end_project_example/tree/main/backend/logs/"
    click Notebook "https://github.com/romainpen/end_to_end_project_example/blob/main/backend/notebook/Diabete_modeling.ipynb"
    click CICD "https://github.com/romainpen/end_to_end_project_example/blob/main/.github/workflows/main.yaml"
    click Docker "https://github.com/romainpen/end_to_end_project_example/tree/main/Dockerfile"
    click Proc "https://github.com/romainpen/end_to_end_project_example/tree/main/Procfile"
```
