# priyanka-senthil/mlops_project_financialcrises architecture

> Architecture diagram of the GitHub repository priyanka-senthil/mlops_project_financialcrises, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/priyanka-senthil/mlops_project_financialcrises
- Repository: https://github.com/priyanka-senthil/mlops_project_financialcrises

## Overview

The Financial Stress Test Platform turns economic and company data into scenario-based forecasts and risk assessments, served through an authenticated API. Its principal user flow is company and scenario selection, feature mapping, three-model inference, and explained risk results. Separate training and data-preparation workflows support the serving path; monitoring, drift detection, alerts, and retraining are additional capabilities. The README documents the broad architecture; source-index references and excerpts support only some implementation-level links, so unsampled connections are not asserted.

Main entry points: [`deployment/api/stress_test_pipeline.py`](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/stress_test_pipeline.py) (Stress-test pipeline), [`dags/prediction_model_training_pipeline.py`](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/dags/prediction_model_training_pipeline.py) (Training orchestration), [`src/data/step2_feature_engineering.py`](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step2_feature_engineering.py) (Feature engineering), [`deployment/api/main.py`](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/main.py) (API entry point)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_collection["Data collection"]
  node_cleaning["Data cleaning"]
  node_features["Feature engineering"]
  node_bias["Bias checks"]
  node_anomalies["Anomaly checks"]
  node_drift["Drift checks"]
  node_validation["Data validation"]
end

subgraph group_models["Model training"]
  node_train_dag["Training orchestration"]
  node_vae["Scenario generator"]
  node_predictors["Financial predictors<br/>[predictor_model.py]"]
  node_risk_model["Anomaly risk model"]
  node_experiment["Experiment tracking<br/>[mlflow_config.py]"]
end

subgraph group_serving["Prediction service"]
  node_user["API entry point<br/>[main.py]"]
  node_auth["Authentication<br/>[auth_system.py]"]
  node_company_data["Company data fetcher"]
  node_model_loader["Model loader<br/>[model_loader.py]"]
  node_mapper["Feature mapper<br/>[feature_mapper.py]"]
  node_orchestrator["Stress-test pipeline"]
  node_explanations["Risk explanations"]
  node_results["Risk results"]
end

subgraph group_ops["Monitoring and operations"]
  node_monitor["Monitoring dashboard"]
  node_alerts["Alerts<br/>[alerting.py]"]
  node_crisis_dag["Data pipeline orchestration"]
end

node_analyst(("Risk analyst"))
node_storage[("Google Cloud Storage")]

node_analyst -->|"requests analysis"| node_user
node_user -->|"authenticates"| node_auth
node_user -->|"fetches company data"| node_company_data
node_user -->|"loads models"| node_model_loader
node_user -->|"runs stress test"| node_orchestrator
node_orchestrator -->|"maps features"| node_mapper
node_orchestrator -->|"generates scenarios"| node_vae
node_orchestrator -->|"forecasts finances"| node_predictors
node_orchestrator -->|"assesses risk"| node_risk_model
node_orchestrator -->|"explains risk"| node_explanations
node_orchestrator -->|"returns assessment"| node_results
node_collection -->|"precedes cleaning"| node_cleaning
node_cleaning -->|"precedes engineering"| node_features
node_features -->|"validates data"| node_validation
node_features -->|"checks bias"| node_bias
node_features -->|"checks anomalies"| node_anomalies
node_features -->|"checks drift"| node_drift
node_crisis_dag -->|"orchestrates data pipeline"| node_collection
node_crisis_dag -->|"stores processed data"| node_storage
node_train_dag -->|"trains predictors"| node_predictors
node_train_dag -->|"trains scenario model"| node_vae
node_train_dag -->|"trains risk model"| node_risk_model
node_train_dag -->|"tracks experiments"| node_experiment
node_drift -->|"notifies drift"| node_alerts
node_monitor -->|"visualizes monitoring"| node_drift
node_storage -->|"provides model artifacts"| node_model_loader
node_train_dag -->|"stores trained models"| node_storage

click node_collection "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step0_data_collection.py"
click node_cleaning "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step1_data_cleaning_and_merging.py"
click node_features "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step2_feature_engineering.py"
click node_bias "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step3_bias_detection_with_explicit_slicing.py"
click node_anomalies "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step4_anomaly_detection.py"
click node_drift "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step5_drift_detection.py"
click node_validation "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/validation/robust_validator.py"
click node_train_dag "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/dags/prediction_model_training_pipeline.py"
click node_vae "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/models/Dense_VAE_optimized_mlflow_updated.py"
click node_predictors "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/models/predictor/predictor_model.py"
click node_risk_model "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/models/train_anomaly_detection.py"
click node_experiment "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/utils/mlflow_config.py"
click node_user "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/main.py"
click node_auth "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/auth_system.py"
click node_company_data "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/gcs_data_fetcher.py"
click node_model_loader "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/model_loader.py"
click node_mapper "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/feature_mapper.py"
click node_orchestrator "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/stress_test_pipeline.py"
click node_explanations "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/stress_test_pipeline.py"
click node_results "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/production_features.py"
click node_monitor "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/model_monitoring_dashboard.py"
click node_alerts "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/monitoring/alerting.py"
click node_crisis_dag "https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/dags/financial_crisis_pipeline.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_collection,node_cleaning,node_features,node_bias,node_anomalies,node_drift,node_validation toneBlue
class node_train_dag,node_vae,node_predictors,node_risk_model,node_experiment,node_storage toneAmber
class node_user,node_auth,node_company_data,node_model_loader,node_mapper,node_orchestrator,node_explanations,node_results toneMint
class node_monitor,node_alerts,node_crisis_dag toneRose
class node_analyst toneIndigo
```

## Components

### Data preparation

- [Data collection](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step0_data_collection.py): `src/data/step0_data_collection.py`
- [Data cleaning](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step1_data_cleaning_and_merging.py): `src/data/step1_data_cleaning_and_merging.py`
- [Feature engineering](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step2_feature_engineering.py): `src/data/step2_feature_engineering.py`
- [Bias checks](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step3_bias_detection_with_explicit_slicing.py): `src/data/step3_bias_detection_with_explicit_slicing.py`
- [Anomaly checks](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step4_anomaly_detection.py): `src/data/step4_anomaly_detection.py`
- [Drift checks](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/data/step5_drift_detection.py): `src/data/step5_drift_detection.py`
- [Data validation](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/validation/robust_validator.py): `src/validation/robust_validator.py`

### Model training

- [Training orchestration](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/dags/prediction_model_training_pipeline.py): `dags/prediction_model_training_pipeline.py`
- [Scenario generator](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/models/Dense_VAE_optimized_mlflow_updated.py): `src/models/Dense_VAE_optimized_mlflow_updated.py`
- [Financial predictors](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/models/predictor/predictor_model.py): `src/models/predictor/predictor_model.py`
- [Anomaly risk model](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/models/train_anomaly_detection.py): `src/models/train_anomaly_detection.py`
- [Experiment tracking](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/utils/mlflow_config.py): `src/utils/mlflow_config.py`

### Prediction service

- [API entry point](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/main.py): `deployment/api/main.py`
- [Authentication](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/auth_system.py): `deployment/api/auth_system.py`
- [Company data fetcher](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/gcs_data_fetcher.py): `deployment/api/gcs_data_fetcher.py`
- [Model loader](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/model_loader.py): `deployment/api/model_loader.py`
- [Feature mapper](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/feature_mapper.py): `deployment/api/feature_mapper.py`
- [Stress-test pipeline](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/stress_test_pipeline.py): `deployment/api/stress_test_pipeline.py`
- [Risk explanations](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/stress_test_pipeline.py): `deployment/api/stress_test_pipeline.py`
- [Risk results](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/deployment/api/production_features.py): `deployment/api/production_features.py`

### Monitoring and operations

- [Monitoring dashboard](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/model_monitoring_dashboard.py): `model_monitoring_dashboard.py`
- [Alerts](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/src/monitoring/alerting.py): `src/monitoring/alerting.py`
- [Data pipeline orchestration](https://github.com/priyanka-senthil/mlops_project_financialcrises/blob/main/dags/financial_crisis_pipeline.py): `dags/financial_crisis_pipeline.py`

### Other components

- **Risk analyst**
- **Google Cloud Storage**

## Connections

- Risk analyst → API entry point: requests analysis
- API entry point → Authentication: authenticates (evidence: `deployment/api/main.py`)
- API entry point → Company data fetcher: fetches company data
- API entry point → Model loader: loads models
- API entry point → Stress-test pipeline: runs stress test
- Stress-test pipeline → Feature mapper: maps features (evidence: `deployment/api/stress_test_pipeline.py`)
- Stress-test pipeline → Scenario generator: generates scenarios
- Stress-test pipeline → Financial predictors: forecasts finances
- Stress-test pipeline → Anomaly risk model: assesses risk
- Stress-test pipeline → Risk explanations: explains risk (evidence: `deployment/api/stress_test_pipeline.py`)
- Stress-test pipeline → Risk results: returns assessment (evidence: `deployment/api/production_features.py`)
- Data collection → Data cleaning: precedes cleaning
- Data cleaning → Feature engineering: precedes engineering
- Feature engineering → Data validation: validates data
- Feature engineering → Bias checks: checks bias
- Feature engineering → Anomaly checks: checks anomalies
- Feature engineering → Drift checks: checks drift
- Data pipeline orchestration → Data collection: orchestrates data pipeline
- Data pipeline orchestration → Google Cloud Storage: stores processed data
- Training orchestration → Financial predictors: trains predictors
- Training orchestration → Scenario generator: trains scenario model
- Training orchestration → Anomaly risk model: trains risk model
- Training orchestration → Experiment tracking: tracks experiments
- Drift checks → Alerts: notifies drift
- Monitoring dashboard → Drift checks: visualizes monitoring
- Google Cloud Storage → Model loader: provides model artifacts
- Training orchestration → Google Cloud Storage: stores trained models
