# hossam-eldin-omar/regiflow architecture

> Architecture diagram of the GitHub repository hossam-eldin-omar/regiflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hossam-eldin-omar/regiflow
- Repository: https://github.com/hossam-eldin-omar/regiflow

## Overview

regiFlow is a local telecom-churn MLOps platform. Its main user workflow is dashboard/API-driven training or model selection and promotion, followed by customer feature retrieval, prediction, logging, and drift/report review. The graph covers documented feature engineering, validation, Feast serving, MLflow lifecycle, and dashboard capabilities. Several integrations and dashboard-to-API details are documented rather than shown in sampled callers; those links are dashed where evidence is indirect.

Main entry points: [`api/main.py`](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/main.py) (FastAPI application), [`api/utils/prediction_service.py`](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/prediction_service.py) (Prediction service), [`pipelines/feature_engineering.py`](https://github.com/hossam-eldin-omar/regiflow/blob/main/pipelines/feature_engineering.py) (Feature engineering), [`training/train_service.py`](https://github.com/hossam-eldin-omar/regiflow/blob/main/training/train_service.py) (Training service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and features"]
  node_raw[("Raw churn data")]
  node_engineering["Feature engineering"]
  node_validation["Feature validation"]
  node_processed[("Processed features")]
  node_feast[("Feast feature store<br/>[feature_views.py]")]
end

subgraph group_ml["Training and registry"]
  node_training_api["Training API<br/>[training.py]"]
  node_training["Training service<br/>[train_service.py]"]
  node_mlflow[("MLflow tracking<br/>[train_service.py]")]
  node_registry_api["Registry API<br/>[registry.py]"]
  node_promotion["Model promotion<br/>[promote.py]"]
end

subgraph group_serving["Prediction service"]
  node_feature_api["Online feature client<br/>[feature_client.py]"]
  node_active_model["Active model reference<br/>[active_model.py]"]
  node_model_loader["Model loader<br/>[model_loader.py]"]
  node_predict_api["Prediction API<br/>[predict.py]"]
  node_prediction["Prediction service"]
  node_app["FastAPI application<br/>[main.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_ops["Monitoring and dashboard"]
  node_prediction_log[("Prediction log")]
  node_drift["Drift reporting<br/>[drift_report.py]"]
  node_monitoring_api["Monitoring and reports API<br/>[monitoring.py]"]
  node_dashboard["Web dashboard<br/>[index.html]"]
end

node_user(("Dashboard user"))

node_raw -->|"preprocesses"| node_engineering
node_engineering -.->|"writes features"| node_processed
node_engineering -->|"validates"| node_validation
node_processed -.->|"loads historical data"| node_feast
node_feast -->|"supplies training data"| node_training
node_training_api -->|"starts training"| node_training
node_training -->|"engineers uploaded data"| node_engineering
node_training -->|"logs runs"| node_mlflow
node_registry_api -.->|"registers models"| node_mlflow
node_registry_api -.->|"promotes versions"| node_promotion
node_promotion -.->|"updates reference"| node_active_model
node_predict_api -->|"requests prediction"| node_prediction
node_prediction -->|"fetches features"| node_feature_api
node_feature_api -->|"queries online features"| node_feast
node_prediction -->|"loads model and threshold"| node_model_loader
node_model_loader -->|"reads model alias"| node_active_model
node_model_loader -.->|"loads registered model"| node_mlflow
node_prediction -->|"logs prediction"| node_prediction_log
node_drift -->|"reads current data"| node_prediction_log
node_drift -.->|"compares reference data"| node_processed
node_monitoring_api -->|"refreshes report"| node_drift
node_app -->|"routes requests"| node_predict_api
node_app -->|"routes requests"| node_training_api
node_app -->|"routes requests"| node_registry_api
node_app -->|"routes requests"| node_monitoring_api
node_app -->|"reads settings"| node_config
node_user -.->|"uses"| node_dashboard
node_dashboard -.->|"calls API"| node_app

click node_raw "https://github.com/hossam-eldin-omar/regiflow/tree/main/data/raw"
click node_engineering "https://github.com/hossam-eldin-omar/regiflow/blob/main/pipelines/feature_engineering.py"
click node_validation "https://github.com/hossam-eldin-omar/regiflow/blob/main/pipelines/validate_features.py"
click node_processed "https://github.com/hossam-eldin-omar/regiflow/tree/main/data/processed"
click node_feast "https://github.com/hossam-eldin-omar/regiflow/blob/main/feature_store/feature_views.py"
click node_feature_api "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/feature_client.py"
click node_training_api "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/training.py"
click node_training "https://github.com/hossam-eldin-omar/regiflow/blob/main/training/train_service.py"
click node_mlflow "https://github.com/hossam-eldin-omar/regiflow/blob/main/training/train_service.py"
click node_registry_api "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/registry.py"
click node_promotion "https://github.com/hossam-eldin-omar/regiflow/blob/main/training/promote.py"
click node_active_model "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/active_model.py"
click node_model_loader "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/model_loader.py"
click node_predict_api "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/predict.py"
click node_prediction "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/prediction_service.py"
click node_prediction_log "https://github.com/hossam-eldin-omar/regiflow/blob/main/monitoring/prediction_logger.py"
click node_drift "https://github.com/hossam-eldin-omar/regiflow/blob/main/monitoring/drift_report.py"
click node_monitoring_api "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/monitoring.py"
click node_dashboard "https://github.com/hossam-eldin-omar/regiflow/blob/main/frontend/index.html"
click node_app "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/main.py"
click node_config "https://github.com/hossam-eldin-omar/regiflow/blob/main/api/core/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_raw,node_engineering,node_validation,node_processed,node_feast,node_user toneBlue
class node_training_api,node_training,node_mlflow,node_registry_api,node_promotion toneAmber
class node_feature_api,node_active_model,node_model_loader,node_predict_api,node_prediction,node_app,node_config toneMint
class node_prediction_log,node_drift,node_monitoring_api,node_dashboard toneRose
```

## Components

### Data and features

- [Raw churn data](https://github.com/hossam-eldin-omar/regiflow/tree/main/data/raw): `data/raw`
- [Feature engineering](https://github.com/hossam-eldin-omar/regiflow/blob/main/pipelines/feature_engineering.py): `pipelines/feature_engineering.py`
- [Feature validation](https://github.com/hossam-eldin-omar/regiflow/blob/main/pipelines/validate_features.py): `pipelines/validate_features.py`
- [Processed features](https://github.com/hossam-eldin-omar/regiflow/tree/main/data/processed): `data/processed`
- [Feast feature store](https://github.com/hossam-eldin-omar/regiflow/blob/main/feature_store/feature_views.py): `feature_store/feature_views.py`

### Training and registry

- [Training API](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/training.py): `api/routers/training.py`
- [Training service](https://github.com/hossam-eldin-omar/regiflow/blob/main/training/train_service.py): `training/train_service.py`
- [MLflow tracking](https://github.com/hossam-eldin-omar/regiflow/blob/main/training/train_service.py): `training/train_service.py`
- [Registry API](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/registry.py): `api/routers/registry.py`
- [Model promotion](https://github.com/hossam-eldin-omar/regiflow/blob/main/training/promote.py): `training/promote.py`

### Prediction service

- [Online feature client](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/feature_client.py): `api/utils/feature_client.py`
- [Active model reference](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/active_model.py): `api/utils/active_model.py`
- [Model loader](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/model_loader.py): `api/utils/model_loader.py`
- [Prediction API](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/predict.py): `api/routers/predict.py`
- [Prediction service](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/utils/prediction_service.py): `api/utils/prediction_service.py`
- [FastAPI application](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/main.py): `api/main.py`
- [Runtime configuration](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/core/config.py): `api/core/config.py`

### Monitoring and dashboard

- [Prediction log](https://github.com/hossam-eldin-omar/regiflow/blob/main/monitoring/prediction_logger.py): `monitoring/prediction_logger.py`
- [Drift reporting](https://github.com/hossam-eldin-omar/regiflow/blob/main/monitoring/drift_report.py): `monitoring/drift_report.py`
- [Monitoring and reports API](https://github.com/hossam-eldin-omar/regiflow/blob/main/api/routers/monitoring.py): `api/routers/monitoring.py`
- [Web dashboard](https://github.com/hossam-eldin-omar/regiflow/blob/main/frontend/index.html): `frontend/index.html`

### Other components

- **Dashboard user**

## Connections

- Raw churn data → Feature engineering: preprocesses (evidence: `pipelines/feature_engineering.py`)
- Feature engineering → Processed features: writes features
- Feature engineering → Feature validation: validates (evidence: `pipelines/validate_features.py`)
- Processed features → Feast feature store: loads historical data
- Feast feature store → Training service: supplies training data (evidence: `training/train_service.py`)
- Training API → Training service: starts training (evidence: `api/routers/training.py`)
- Training service → Feature engineering: engineers uploaded data (evidence: `training/train_service.py`)
- Training service → MLflow tracking: logs runs (evidence: `training/train_service.py`)
- Registry API → MLflow tracking: registers models
- Registry API → Model promotion: promotes versions
- Model promotion → Active model reference: updates reference
- Prediction API → Prediction service: requests prediction (evidence: `api/routers/predict.py`)
- Prediction service → Online feature client: fetches features (evidence: `api/utils/prediction_service.py`)
- Online feature client → Feast feature store: queries online features (evidence: `api/utils/feature_client.py`)
- Prediction service → Model loader: loads model and threshold (evidence: `api/utils/prediction_service.py`)
- Model loader → Active model reference: reads model alias (evidence: `api/utils/model_loader.py`)
- Model loader → MLflow tracking: loads registered model
- Prediction service → Prediction log: logs prediction (evidence: `api/utils/prediction_service.py`)
- Drift reporting → Prediction log: reads current data (evidence: `monitoring/drift_report.py`)
- Drift reporting → Processed features: compares reference data
- Monitoring and reports API → Drift reporting: refreshes report (evidence: `api/routers/monitoring.py`)
- FastAPI application → Prediction API: routes requests (evidence: `api/main.py`)
- FastAPI application → Training API: routes requests (evidence: `api/main.py`)
- FastAPI application → Registry API: routes requests (evidence: `api/main.py`)
- FastAPI application → Monitoring and reports API: routes requests (evidence: `api/main.py`)
- FastAPI application → Runtime configuration: reads settings (evidence: `api/main.py`)
- Dashboard user → Web dashboard: uses
- Web dashboard → FastAPI application: calls API
