# vikashishere/yt-capstone-project architecture

> Architecture diagram of the GitHub repository vikashishere/yt-capstone-project, 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/vikashishere/yt-capstone-project
- Repository: https://github.com/vikashishere/yt-capstone-project

## Overview

##### Project type and purpose
- This is an end-to-end MLOps capstone project that encompasses data ingestion, preprocessing, feature engineering, model training, evaluation, registration, and deployment.
- It includes a model serving layer (a Flask application), versioned pipelines (DVC + Makefile), CI (GitHub Actions), containerization (Dockerfile), and deployment manifest (deployment.yaml).

##### File structure
- Top-level orchestration:
– dvc.yaml, dvc.lock, .dvc/ : defines and tracks the data pipeline stages
– Makefile / docs/Makefile : build and docs targets
– Dockerfile / deployment.yaml : container build and k8s deployment
– .github/workflows_stop/ci.yaml : continuous integration pipeline
- Source code:
– src/ :
· connections/ : database or cloud storage connectors (S3, SSMS)
· data/ : ingestion and preprocessing routines
· features/ : feature engineering
· model/ : train_model, model_building, evaluation, register_model, predict_model
· visualization/ : result plotting
· logger/ : logging setup
- Model serving:
– flask_app/ : Flask API endpoints, HTML template
- Experiments & reports:
– notebooks/ : exploratory experiments (IMDB sentiment data)
– reports/ : figures and write-ups
- Utilities:
– scripts/promote_model.py : script to move a model from staging to production
– tests/ & test_environment.py : unit/integration tests
– params.yaml, requirements.txt, setup.py : config, dependencies, packaging

##### README
- Minimal; confirms “end to end mlops capstone project for educational purpose.”
- Implies demonstration of MLOps best practices, pipeline orchestration, model serving and deployment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Sources
    subgraph "Data Sources"
        DS_CSV["Local CSV (IMDB.csv)"]:::data
        DS_SSMS["SSMS Database"]:::data
        DS_S3["S3 Storage"]:::data
    end
    click DS_CSV "https://github.com/vikashishere/yt-capstone-project/blob/main/notebooks/IMDB.csv"
    click DS_SSMS "https://github.com/vikashishere/yt-capstone-project/blob/main/src/connections/ssms_connection.py"
    click DS_S3 "https://github.com/vikashishere/yt-capstone-project/blob/main/src/connections/s3_connection.py"

    %% Development Research
    subgraph "Dev Research"
        Notebooks["Experiment Notebooks"]:::ext
        Reports["Reports & Figures"]:::ext
    end
    click Notebooks "https://github.com/vikashishere/yt-capstone-project/tree/main/notebooks/"
    click Reports "https://github.com/vikashishere/yt-capstone-project/tree/main/reports/"

    %% Pipeline Orchestrator
    subgraph "Pipeline Orchestrator"
        DVC["DVC Config (dvc.yaml, .dvc/)"]:::pipeline
        Make["Makefile"]:::pipeline
    end
    click DVC "https://github.com/vikashishere/yt-capstone-project/blob/main/dvc.yaml"
    click Make "https://github.com/vikashishere/yt-capstone-project/tree/main/Makefile"

    %% Pipeline Stages
    subgraph "Pipeline Stages"
        Ingest["Data Ingestion"]:::pipeline
        Preproc["Data Preprocessing"]:::pipeline
        Feature["Feature Engineering"]:::pipeline
        Train["Train Model"]:::pipeline
        Evaluate["Model Evaluation"]:::pipeline
        Register["Register Model"]:::pipeline
    end
    click Ingest "https://github.com/vikashishere/yt-capstone-project/blob/main/src/data/data_ingestion.py"
    click Preproc "https://github.com/vikashishere/yt-capstone-project/blob/main/src/data/data_preprocessing.py"
    click Feature "https://github.com/vikashishere/yt-capstone-project/blob/main/src/features/feature_engineering.py"
    click Train "https://github.com/vikashishere/yt-capstone-project/blob/main/src/model/train_model.py"
    click Evaluate "https://github.com/vikashishere/yt-capstone-project/blob/main/src/model/model_evaluation.py"
    click Register "https://github.com/vikashishere/yt-capstone-project/blob/main/src/model/register_model.py"

    %% Model Logic Components
    subgraph "Model Logic"
        Build["Model Building"]:::pipeline
        Predict["Predict Model"]:::pipeline
        Logging["Logging Utility"]:::util
    end
    click Build "https://github.com/vikashishere/yt-capstone-project/blob/main/src/model/model_building.py"
    click Predict "https://github.com/vikashishere/yt-capstone-project/blob/main/src/model/predict_model.py"
    click Logging "https://github.com/vikashishere/yt-capstone-project/blob/main/src/logger/__init__.py"

    %% Artifacts & Config
    Artifacts["Artifacts & Versioning"]:::data
    Config["Parameters (params.yaml)"]:::data
    click Config "https://github.com/vikashishere/yt-capstone-project/blob/main/params.yaml"

    %% Model Registry
    Registry["Model Registry"]:::data

    %% Model Serving
    subgraph "Model Serving"
        Flask["Flask API"]:::deployment
        PreUtil["Serving Preprocessing"]:::deployment
        UI["Flask Templates"]:::deployment
    end
    click Flask "https://github.com/vikashishere/yt-capstone-project/blob/main/flask_app/app.py"
    click PreUtil "https://github.com/vikashishere/yt-capstone-project/blob/main/flask_app/preprocessing_utility.py"
    click UI "https://github.com/vikashishere/yt-capstone-project/blob/main/flask_app/templates/index.html"

    %% Deployment
    subgraph "Deployment"
        Docker["Docker Image"]:::deployment
        K8s["Kubernetes Deployment"]:::deployment
    end
    click Docker "https://github.com/vikashishere/yt-capstone-project/tree/main/Dockerfile"
    click K8s "https://github.com/vikashishere/yt-capstone-project/blob/main/deployment.yaml"

    %% CI/CD
    subgraph "CI/CD"
        CI["GitHub Actions CI"]:::ci
        Tests["Tests"]:::ci
        Tox["tox.ini"]:::ci
        Promote["Model Promotion Script"]:::ci
    end
    click CI "https://github.com/vikashishere/yt-capstone-project/blob/main/.github/workflows_stop/ci.yaml"
    click Tests "https://github.com/vikashishere/yt-capstone-project/tree/main/tests/"
    click Tox "https://github.com/vikashishere/yt-capstone-project/blob/main/tox.ini"
    click Promote "https://github.com/vikashishere/yt-capstone-project/blob/main/scripts/promote_model.py"

    %% Connections
    DS_CSV --> Ingest
    DS_SSMS --> Ingest
    DS_S3 --> Ingest
    Notebooks --> Ingest
    Make --> DVC --> Ingest
    Ingest --> Preproc --> Feature --> Train --> Evaluate --> Register --> Registry
    Feature --> Train
    Train --> Build
    Preproc --> PreUtil
    Registry --> Flask
    Flask --> Docker --> K8s
    CI --> Make
    CI --> Tests
    CI --> Tox
    Registry --> Promote
    Evaluate --> Reports
    Logging --> Ingest
    Logging --> Preproc
    Logging --> Feature
    Logging --> Train
    Logging --> Evaluate
    Logging --> Register
    Logging --> Flask

    %% Styles
    classDef data fill:#f6c177,color:#000;
    classDef pipeline fill:#8fb9e0,color:#000;
    classDef deployment fill:#a8d5ba,color:#000;
    classDef ci fill:#cccccc,color:#000;
    classDef ext fill:#f7e59d,color:#000;
    classDef util fill:#d3b8ae,color:#000;
```
