# itskhateeb/mlops-project architecture

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

- Interactive diagram: https://gitdiagram.com/itskhateeb/mlops-project
- Repository: https://github.com/itskhateeb/mlops-project

## Overview

##### Project type and purpose
- This is an end-to-end MLOps pipeline (a “full-stack” machine learning application).
- It covers data ingestion, preprocessing, model training/evaluation, artifact storage, deployment via Docker, and monitoring/versioning using cloud services (AWS S3, MongoDB).

##### File structure
- Top-level:
- app.py / demo.py / notebook/ – entry-points (Flask app / demo script / Jupyter demo)
- Dockerfile / .dockerignore / requirements.txt / setup.py / pyproject.toml – containerization & packaging
- config/ – YAML configs for schemas & models
- static/ & templates/ – web UI assets
- src/ holds all Python code, subdivided into:
- src/components – core ML pipeline stages (data_ingestion, transformation, validation, training, evaluation, model_pusher)
- src/pipline – orchestrators (training_pipeline.py, prediction_pipeline.py)
- src/cloud_storage – AWS S3 adapter
- src/configuration – AWS & MongoDB connection setup
- src/data_access – abstractions for data I/O
- src/entity – typed entities (artifacts, configs, estimators)
- src/logger / src/exception / src/utils / src/constants – support modules

##### README
- Confirms the CI/CD, Dockerization, deployment, monitoring, versioning aspects.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        UI["Vehicle Data UI"]:::frontend
        CSS["CSS (style.css)"]:::frontend
        UI --> CSS
    end
    click UI "https://github.com/itskhateeb/mlops-project/blob/main/templates/vehicledata.html"
    click CSS "https://github.com/itskhateeb/mlops-project/blob/main/static/css/style.css"

    subgraph "Backend API"
        API["Flask App"]:::frontend
    end
    click API "https://github.com/itskhateeb/mlops-project/blob/main/app.py"

    subgraph "Pipelines"
        API --> TP["Training Pipeline"]:::pipeline
        API --> PP["Prediction Pipeline"]:::pipeline
    end
    click TP "https://github.com/itskhateeb/mlops-project/blob/main/src/pipline/training_pipeline.py"
    click PP "https://github.com/itskhateeb/mlops-project/blob/main/src/pipline/prediction_pipeline.py"

    subgraph "Training Pipeline"
        TI["Data Ingestion"]:::pipeline
        TT["Data Transformation"]:::pipeline
        TV["Data Validation"]:::pipeline
        TM["Model Training"]:::pipeline
        TE["Model Evaluation"]:::pipeline
        TPu["Model Pusher"]:::pipeline
        TI --> TT --> TV --> TM --> TE --> TPu
    end
    click TI "https://github.com/itskhateeb/mlops-project/blob/main/src/components/data_ingestion.py"
    click TT "https://github.com/itskhateeb/mlops-project/blob/main/src/components/data_transformation.py"
    click TV "https://github.com/itskhateeb/mlops-project/blob/main/src/components/data_validation.py"
    click TM "https://github.com/itskhateeb/mlops-project/blob/main/src/components/model_trainer.py"
    click TE "https://github.com/itskhateeb/mlops-project/blob/main/src/components/model_evaluation.py"
    click TPu "https://github.com/itskhateeb/mlops-project/blob/main/src/components/model_pusher.py"

    subgraph "Cloud Services"
        AWSConn["AWS Connection"]:::config
        S3["AWS S3"]:::datastore
        MongoConn["MongoDB Connection"]:::config
        Mdb["MongoDB"]:::datastore
    end
    click AWSConn "https://github.com/itskhateeb/mlops-project/blob/main/src/configuration/aws_connection.py"
    click S3 "https://github.com/itskhateeb/mlops-project/blob/main/src/cloud_storage/aws_storage.py"
    click MongoConn "https://github.com/itskhateeb/mlops-project/blob/main/src/configuration/mongo_db_connection.py"

    AWSConn --> S3
    MongoConn --> Mdb
    TPu --> S3
    TE --> Mdb

    subgraph "CI/CD & Containerization"
        CI["CI/CD Pipeline"]:::ci
        Docker["Docker & Packaging"]:::ci
        CI --> Docker --> API
    end
    click Docker "https://github.com/itskhateeb/mlops-project/tree/main/Dockerfile"
    click Docker "https://github.com/itskhateeb/mlops-project/blob/main/.dockerignore"
    click Docker "https://github.com/itskhateeb/mlops-project/blob/main/requirements.txt"
    click Docker "https://github.com/itskhateeb/mlops-project/blob/main/setup.py"
    click Docker "https://github.com/itskhateeb/mlops-project/blob/main/pyproject.toml"

    subgraph "Ad-hoc Analysis"
        Demo["Demo Script"]:::adhoc
        Notebook["Jupyter Notebook"]:::adhoc
        CSV["CSV Data"]:::adhoc
        Demo --> Notebook --> CSV
    end
    click Demo "https://github.com/itskhateeb/mlops-project/blob/main/demo.py"
    click Notebook "https://github.com/itskhateeb/mlops-project/blob/main/notebook/mongoDB_demo.ipynb"
    click CSV "https://github.com/itskhateeb/mlops-project/blob/main/notebook/data.csv"

    subgraph "Configuration & Entities"
        ModelCfg["model.yaml"]:::config
        SchemaCfg["schema.yaml"]:::config
        ConfEntity["Config Entity"]:::config
        ArtEntity["Artifact Entity"]:::config
        EstEntity["Estimator Entity"]:::config
        S3Est["S3 Estimator"]:::config
        DataAccess["Data Access"]:::config
        Logger["Logging Module"]:::config
        Utils["Utility Functions"]:::config
    end
    click ModelCfg "https://github.com/itskhateeb/mlops-project/blob/main/config/model.yaml"
    click SchemaCfg "https://github.com/itskhateeb/mlops-project/blob/main/config/schema.yaml"
    click ConfEntity "https://github.com/itskhateeb/mlops-project/blob/main/src/entity/config_entity.py"
    click ArtEntity "https://github.com/itskhateeb/mlops-project/blob/main/src/entity/artifact_entity.py"
    click EstEntity "https://github.com/itskhateeb/mlops-project/blob/main/src/entity/estimator.py"
    click S3Est "https://github.com/itskhateeb/mlops-project/blob/main/src/entity/s3_estimator.py"
    click DataAccess "https://github.com/itskhateeb/mlops-project/blob/main/src/data_access/proj1_data.py"
    click Logger "https://github.com/itskhateeb/mlops-project/blob/main/src/logger/__init__.py"
    click Utils "https://github.com/itskhateeb/mlops-project/blob/main/src/utils/main_utils.py"

    ConfEntity --> TP
    ConfEntity --> PP
    Utils --> TP
    Utils --> PP
    DataAccess --> TI

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef pipeline fill:#87CEFA,stroke:#333,stroke-width:1px
    classDef datastore fill:#90EE90,stroke:#333,stroke-width:1px
    classDef config fill:#FFFFE0,stroke:#333,stroke-width:1px
    classDef ci fill:#FFD700,stroke:#333,stroke-width:1px
    classDef adhoc fill:#D8BFD8,stroke:#333,stroke-width:1px
```
