How sujith-chowdary/bank-ml-production-pipeline works
This is a bank-customer churn prediction system. Cleaned customer data is split into files, then an Airflow ingestion DAG validates files, produces reports, records ingestion statistics, and separates valid from invalid data. A scheduled DAG submits valid files to the FastAPI prediction endpoint; the API preprocesses and scores them, stores predictions, and returns results. The Streamlit interface supports single, batch, and historical predictions. The README also documents drift monitoring and Grafana dashboards; their implementation is not present in the supplied tree. Edges reflect shown calls or documented workflow; unsampled subsystem details are omitted.
Main entry points: data_ingestion_dag.py Ingestion DAG · main_api.py FastAPI Service · db.py PostgreSQL Data · split_dataset.py File Splitter
Components 18
Data Quality
- File Splitter
Data/split_dataset.py - Incoming Files
Data/raw-data - Ingestion DAG
airflow/dags/data_ingestion_dag.py - Quality Checks
Data/great_expectations/gx/expectations - Validation Reports
Data/reports/data_docs - Validated Files
- Rejected Files
- Archived Files
Data/archive_raw
Prediction
- Model Training
model/model_training.py - Model Inference
fastapi_app/churn_model.py - Scheduled Predictions
airflow/dags/prediction_dag.py
Serving
- Prediction UI
webapp/main.py - FastAPI Service
fastapi_app/main_api.py - PostgreSQL Data
database/db.py
Monitoring
- Teams Alerts
airflow/dags/send_alerts.py - Grafana Dashboards
Other components
- Analyst
- Microsoft Teams
Connections 19
- Analyst → File Splitter: prepares data
README.md - File Splitter → Incoming Files: writes files
Data/split_dataset.py - Incoming Files → Ingestion DAG: selects files
airflow/dags/data_ingestion_dag.py - Ingestion DAG → Quality Checks: runs checks
airflow/dags/data_ingestion_dag.py - Ingestion DAG → Validation Reports: builds reports
airflow/dags/data_ingestion_dag.py - Ingestion DAG → Validated Files: writes valid rows
airflow/dags/data_ingestion_dag.py - Ingestion DAG → Rejected Files: writes invalid rows
airflow/dags/data_ingestion_dag.py - Ingestion DAG → Archived Files: archives files
airflow/dags/data_ingestion_dag.py - Ingestion DAG → PostgreSQL Data: records statistics
airflow/dags/data_ingestion_dag.py - Ingestion DAG → Teams Alerts: invokes alert
airflow/dags/data_ingestion_dag.py - Teams Alerts → Microsoft Teams: posts alert
airflow/dags/send_alerts.py - Model Training → Model Inference: produces model artifacts
- Validated Files → Scheduled Predictions: provides files
airflow/dags/prediction_dag.py - Scheduled Predictions → FastAPI Service: posts batch data
airflow/dags/prediction_dag.py - Prediction UI → FastAPI Service: requests predictions
webapp/main.py - FastAPI Service → Model Inference: runs inference
fastapi_app/main_api.py - FastAPI Service → PostgreSQL Data: stores and queries
fastapi_app/main_api.py - Analyst → Prediction UI: submits requests
- PostgreSQL Data → Grafana Dashboards: feeds dashboards