# arijit-chandra/mlops-machine-learning-based-visa-certification-prediction architecture

> Architecture diagram of the GitHub repository arijit-chandra/mlops-machine-learning-based-visa-certification-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction
- Repository: https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction

## Overview

##### Main Components
a. Frontend / API Layer
- app.py (Flask application entrypoint)
- demo.py (CLI or quick-demo script)
- templates/*.html & static/css (UI assets)
b. ML Backend / Business Logic
- us_visa_prediction package
- components/ (data_ingestion, data_transformation, validation, model_trainer, model_evaluation, model_pusher, model_factory)
- pipline/ (training_pipeline.py, prediction_pipeline.py)
- configuration/ (mongo_db_connection.py, azure_connection.py)
- data_access/ (easyvisa_data.py)
- entity/ (config_entity, artifact_entity, estimator entities)
- utils/main_utils.py, logger, exception
c. Data Stores & External Services
- MongoDB Atlas (metadata, schema registry)
- Azure Blob Storage (model artifacts)
- Kaggle-sourced dataset (CSV)
- Evidently AI (monitoring dashboards)
d. CI/CD & Deployment
- Dockerfile & .dockerignore
- GitHub Actions workflow (build → test → deploy)
- Azure (Container Registry or Web App, Azure Monitor)

##### Relationships & Data Flow
- User → Flask App: submits input or triggers training/prediction
- Flask App → Prediction Pipeline: loads latest model from Azure Blob via azure_storage client
- Prediction Pipeline → MongoDB: reads schema/config or logs prediction events
- Training Pipeline → Data Access: ingests EasyVisa.csv
- Training Pipeline → Components: validation → transformation → model_trainer → model_evaluation → model_pusher
- model_pusher → Azure Blob Storage: uploads new model
- CI/CD → Docker Build → Azure Deployment
- Evidently → Monitors model performance in production

##### Architectural Patterns & Design Principles
- Layered modular design (components, pipeline, data_access, configuration, entity)
- Separation of concerns (training vs. prediction pipelines)
- Externalized configuration (model.yaml, schema.yaml, environment variables for DB & storage)
- Infrastructure as code / containerization
- CI/CD automation with GitHub Actions
- MLOps best practices (model registry, monitoring, reproducibility)

##### Technologies & Frameworks
- Python, Flask
- CatBoost (used in notebooks, via model_factory)
- MongoDB Atlas (NoSQL metadata store)
- Azure Blob Storage (model artifact store)
- Docker, GitHub Actions, Azure CI/CD
- Evidently AI for drift monitoring
- Jupyter Notebooks for EDA & prototype training

##### Elements
- Explicit representation of config files (model.yaml, schema.yaml) feeding into configuration components
- A “Monitoring” block (Evidently AI, Azure Monitor) hooked to production logs

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External User
    User["User"]:::external

    %% Frontend / API Layer
    subgraph "Frontend / API Layer"
        App["Flask App\n(app.py)"]:::compute
        Demo["Demo Script\n(demo.py)"]:::compute
        TemplatesSub["UI Templates & Styles"]:::compute
        DemoHTML["templates/demo.html"]:::compute
        USVisaHTML["templates/usvisa.html"]:::compute
        Styles["static/css/styles.css"]:::compute
    end

    %% ML Backend / Business Logic
    subgraph "ML Backend / Business Logic"
        subgraph "Configuration Files"
            ModelCFG["model.yaml"]:::compute
            SchemaCFG["schema.yaml"]:::compute
        end
        subgraph "Components"
            DI["Data Ingestion"]:::compute
            DT["Data Transformation"]:::compute
            DV["Data Validation"]:::compute
            MTn["Model Trainer"]:::compute
            ME["Model Evaluation"]:::compute
            MP["Model Pusher"]:::compute
            MF["Model Factory"]:::compute
        end
        subgraph "Pipelines"
            TP["Training Pipeline"]:::compute
            PP["Prediction Pipeline"]:::compute
        end
        subgraph "Configuration Connectors"
            MDBC["MongoDB Connection"]:::compute
            AZC["Azure Connection"]:::compute
        end
        DAL["Data Access\n(EasyVisa)"]:::compute
        Utils["Utilities"]:::compute
        Logger["Logger Module"]:::compute
        Exception["Exception Module"]:::compute
        CloudStorage["Azure Storage\n(Client)"]:::compute
    end

    %% Data Stores & External Services
    subgraph "Data Stores & External Services"
        Mongo["MongoDB Atlas"]:::datastore
        Blob["Azure Blob Storage"]:::datastore
        Kaggle["Kaggle Dataset (CSV)"]:::datastore
        Evidently["Evidently AI"]:::datastore
    end

    %% CI/CD & Deployment
    subgraph "CI/CD & Deployment"
        GH["GitHub Actions"]:::cicd
        Docker["Docker"]:::cicd
        AzureDeploy["Azure Deployment"]:::cicd
    end

    %% Connections
    User -->|"Interacts"| App
    App -->|"POST /predict"| PP
    App -->|"Triggers CLI"| Demo
    PP -->|"loads model"| CloudStorage
    PP -->|"reads schema"| MDBC
    PP -->|"logs prediction"| Mongo
    TP -->|"ingests data"| DAL
    TP -->|"validates"| DV
    DV -->|"transforms"| DT
    DT -->|"trains"| MTn
    MTn -->|"evaluates"| ME
    ME -->|"pushes"| MP
    MP -->|"uploads model"| Blob
    TP -->|"uses config"| ModelCFG
    TP -->|"uses config"| SchemaCFG
    ModelCFG --> MDBC
    SchemaCFG --> MDBC
    MDBC -->|"env:MONGO_URL"| Mongo
    AZC -->|"env:STORAGE_CONN"| Blob
    AZC --> CloudStorage
    GH -->|"on push"| Docker
    Docker -->|"build image"| AzureDeploy
    AzureDeploy -->|"deploy"| App
    Evidently -->|"monitors"| App

    %% Click Events
    click App "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/app.py"
    click Demo "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/demo.py"
    click DemoHTML "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/templates/demo.html"
    click USVisaHTML "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/templates/usvisa.html"
    click Styles "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/static/css/styles.css"
    click ModelCFG "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/config/model.yaml"
    click SchemaCFG "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/config/schema.yaml"
    click DI "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/components/data_ingestion.py"
    click DT "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/components/data_transformation.py"
    click DV "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/components/data_validation.py"
    click MTn "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/components/model_trainer.py"
    click ME "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/components/model_evaluation.py"
    click MP "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/components/model_pusher.py"
    click MF "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/components/model_factory.py"
    click TP "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/pipline/training_pipeline.py"
    click PP "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/pipline/prediction_pipeline.py"
    click MDBC "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/configuration/mongo_db_connection.py"
    click AZC "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/configuration/azure_connection.py"
    click DAL "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/data_access/easyvisa_data.py"
    click Utils "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/utils/main_utils.py"
    click Logger "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/tree/main/us_visa_prediction/logger"
    click Exception "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/tree/main/us_visa_prediction/exception"
    click CloudStorage "https://github.com/arijit-chandra/mlops-machine-learning-based-visa-certification-prediction/blob/main/us_visa_prediction/cloud_storage/azure_storage.py"

    %% Styles
    classDef compute fill:#D2E5FF,stroke:#3B6EA5,stroke-width:1px
    classDef datastore fill:#DFF2BF,stroke:#4F8A10,stroke-width:1px
    classDef cicd fill:#FEEFB3,stroke:#9F6000,stroke-width:1px
    classDef external fill:#F2F2F2,stroke:#666666,stroke-width:1px
```
