# khanh2802/customer360-banking-lakehouse architecture

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

- Interactive diagram: https://gitdiagram.com/khanh2802/customer360-banking-lakehouse
- Repository: https://github.com/khanh2802/customer360-banking-lakehouse

## Overview

This is a retail-banking Customer 360 lakehouse: synthetic operational data is ingested into Bronze, conformed into Silver, and transformed into Gold analytics, with a masked mart served to analysts through Trino and a Streamlit dashboard. Airflow orchestrates ETL and operational jobs. The graph preserves the documented segmentation, campaign, cohort, profile, and pipeline-health capabilities. Some ETL and dashboard links are based on README or source-index references; unsampled implementations are not assumed to show additional calls.

Main entry points: [`dashboard/app.py`](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/app.py) (Streamlit app), [`dashboard/utils.py`](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/utils.py) (Trino query utilities), [`code_etl/bronze/base_job/ingestion_jdbc.py`](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/code_etl/bronze/base_job/ingestion_jdbc.py) (Bronze JDBC ingestion), [`airflow/dags`](https://github.com/khanh2802/customer360-banking-lakehouse/tree/main/airflow/dags) (Airflow orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Data generation"]
  node_generator["Synthetic data generator<br/>[sql_runner.py]"]
end

subgraph group_pipeline["Lakehouse pipeline"]
  node_airflow["Airflow orchestration"]
  node_bronze["Bronze JDBC ingestion<br/>[ingestion_jdbc.py]"]
  node_silver["Silver conformance"]
  node_gold["Gold marts and analytics<br/>[gold_job.py]"]
  node_masking["PII masking<br/>[pii_masking.py]"]
end

subgraph group_serving["Analytics serving"]
  node_trino["Trino SQL serving"]
end

subgraph group_dashboard["Streamlit dashboard"]
  node_app["Streamlit app<br/>[app.py]"]
  node_query["Trino query utilities<br/>[utils.py]"]
  node_overview_eda["Overview and EDA<br/>[overview.py]"]
  node_rfm["RFM and geography<br/>[rfm_geo.py]"]
  node_cohort["Cohort analysis<br/>[cohort.py]"]
  node_profile["Customer profile"]
  node_campaign["Campaign targeting<br/>[campaign.py]"]
  node_cross_sell["Cross-sell opportunities<br/>[cross_sell.py]"]
  node_ops_health["Pipeline health<br/>[ops_health.py]"]
  node_mock["Mock data fallback<br/>[mock_data.py]"]
end

node_marketing(("Marketing / analysts"))
node_oracle[("Oracle core banking")]
node_postgres[("PostgreSQL card + CRM")]
node_iceberg[("Iceberg lakehouse")]
node_powerbi["Power BI reports"]

node_generator -->|"seeds data"| node_oracle
node_generator -->|"seeds data"| node_postgres
node_oracle -->|"JDBC ingest"| node_bronze
node_postgres -->|"JDBC ingest"| node_bronze
node_airflow -->|"orchestrates"| node_bronze
node_airflow -->|"orchestrates"| node_silver
node_airflow -->|"orchestrates"| node_gold
node_bronze -->|"writes raw tables"| node_iceberg
node_silver -->|"writes conformed data"| node_iceberg
node_gold -->|"writes marts"| node_iceberg
node_gold -.->|"provides customer mart"| node_masking
node_masking -->|"writes masked copy"| node_iceberg
node_iceberg -->|"serves SQL"| node_trino
node_trino -->|"enables self-service queries"| node_marketing
node_trino -->|"serves reports"| node_powerbi
node_app -->|"routes to"| node_overview_eda
node_app -->|"routes to"| node_rfm
node_app -->|"routes to"| node_cohort
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_campaign
node_app -->|"routes to"| node_cross_sell
node_app -->|"routes to"| node_ops_health
node_overview_eda -->|"queries through"| node_query
node_rfm -->|"queries through"| node_query
node_cohort -->|"queries through"| node_query
node_profile -->|"queries through"| node_query
node_campaign -->|"queries through"| node_query
node_cross_sell -->|"queries through"| node_query
node_ops_health -.->|"queries through"| node_query
node_query -->|"runs SQL"| node_trino
node_profile -->|"falls back to"| node_mock
node_marketing -->|"uses dashboard"| node_app

click node_generator "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/data_generator/loaders/sql_runner.py"
click node_airflow "https://github.com/khanh2802/customer360-banking-lakehouse/tree/main/airflow/dags"
click node_bronze "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/code_etl/bronze/base_job/ingestion_jdbc.py"
click node_silver "https://github.com/khanh2802/customer360-banking-lakehouse/tree/main/code_etl/silver/base_job"
click node_gold "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/code_etl/gold/base_job/gold_job.py"
click node_masking "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/code_etl/shared/ops/pii_masking.py"
click node_app "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/app.py"
click node_query "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/utils.py"
click node_overview_eda "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/overview.py"
click node_rfm "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/rfm_geo.py"
click node_cohort "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/cohort.py"
click node_profile "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/customer_profile.py"
click node_campaign "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/campaign.py"
click node_cross_sell "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/cross_sell.py"
click node_ops_health "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/ops_health.py"
click node_mock "https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/mock_data.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_generator toneBlue
class node_airflow,node_bronze,node_silver,node_gold,node_masking,node_oracle,node_postgres,node_iceberg toneAmber
class node_trino toneMint
class node_app,node_query,node_overview_eda,node_rfm,node_cohort,node_profile,node_campaign,node_cross_sell,node_ops_health,node_mock toneRose
class node_marketing,node_powerbi toneIndigo
```

## Components

### Data generation

- [Synthetic data generator](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/data_generator/loaders/sql_runner.py): `data_generator/loaders/sql_runner.py`

### Lakehouse pipeline

- [Airflow orchestration](https://github.com/khanh2802/customer360-banking-lakehouse/tree/main/airflow/dags): `airflow/dags`
- [Bronze JDBC ingestion](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/code_etl/bronze/base_job/ingestion_jdbc.py): `code_etl/bronze/base_job/ingestion_jdbc.py`
- [Silver conformance](https://github.com/khanh2802/customer360-banking-lakehouse/tree/main/code_etl/silver/base_job): `code_etl/silver/base_job`
- [Gold marts and analytics](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/code_etl/gold/base_job/gold_job.py): `code_etl/gold/base_job/gold_job.py`
- [PII masking](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/code_etl/shared/ops/pii_masking.py): `code_etl/shared/ops/pii_masking.py`

### Analytics serving

- **Trino SQL serving**

### Streamlit dashboard

- [Streamlit app](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/app.py): `dashboard/app.py`
- [Trino query utilities](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/utils.py): `dashboard/utils.py`
- [Overview and EDA](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/overview.py): `dashboard/views/overview.py`
- [RFM and geography](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/rfm_geo.py): `dashboard/views/rfm_geo.py`
- [Cohort analysis](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/cohort.py): `dashboard/views/cohort.py`
- [Customer profile](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/customer_profile.py): `dashboard/views/customer_profile.py`
- [Campaign targeting](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/campaign.py): `dashboard/views/campaign.py`
- [Cross-sell opportunities](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/cross_sell.py): `dashboard/views/cross_sell.py`
- [Pipeline health](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/views/ops_health.py): `dashboard/views/ops_health.py`
- [Mock data fallback](https://github.com/khanh2802/customer360-banking-lakehouse/blob/main/dashboard/mock_data.py): `dashboard/mock_data.py`

### Other components

- **Marketing / analysts**
- **Oracle core banking**
- **PostgreSQL card + CRM**
- **Iceberg lakehouse**
- **Power BI reports**

## Connections

- Synthetic data generator → Oracle core banking: seeds data
- Synthetic data generator → PostgreSQL card + CRM: seeds data
- Oracle core banking → Bronze JDBC ingestion: JDBC ingest
- PostgreSQL card + CRM → Bronze JDBC ingestion: JDBC ingest
- Airflow orchestration → Bronze JDBC ingestion: orchestrates
- Airflow orchestration → Silver conformance: orchestrates
- Airflow orchestration → Gold marts and analytics: orchestrates
- Bronze JDBC ingestion → Iceberg lakehouse: writes raw tables (evidence: `code_etl/bronze/base_job/ingestion_jdbc.py`)
- Silver conformance → Iceberg lakehouse: writes conformed data
- Gold marts and analytics → Iceberg lakehouse: writes marts
- Gold marts and analytics → PII masking: provides customer mart
- PII masking → Iceberg lakehouse: writes masked copy
- Iceberg lakehouse → Trino SQL serving: serves SQL
- Trino SQL serving → Marketing / analysts: enables self-service queries
- Trino SQL serving → Power BI reports: serves reports
- Streamlit app → Overview and EDA: routes to (evidence: `dashboard/app.py`)
- Streamlit app → RFM and geography: routes to (evidence: `dashboard/app.py`)
- Streamlit app → Cohort analysis: routes to (evidence: `dashboard/app.py`)
- Streamlit app → Customer profile: routes to (evidence: `dashboard/app.py`)
- Streamlit app → Campaign targeting: routes to (evidence: `dashboard/app.py`)
- Streamlit app → Cross-sell opportunities: routes to (evidence: `dashboard/app.py`)
- Streamlit app → Pipeline health: routes to (evidence: `dashboard/app.py`)
- Overview and EDA → Trino query utilities: queries through (evidence: `dashboard/views/overview.py`)
- RFM and geography → Trino query utilities: queries through (evidence: `dashboard/views/rfm_geo.py`)
- Cohort analysis → Trino query utilities: queries through (evidence: `dashboard/views/cohort.py`)
- Customer profile → Trino query utilities: queries through (evidence: `dashboard/views/customer_profile.py`)
- Campaign targeting → Trino query utilities: queries through (evidence: `dashboard/views/campaign.py`)
- Cross-sell opportunities → Trino query utilities: queries through (evidence: `dashboard/views/cross_sell.py`)
- Pipeline health → Trino query utilities: queries through
- Trino query utilities → Trino SQL serving: runs SQL (evidence: `dashboard/utils.py`)
- Customer profile → Mock data fallback: falls back to (evidence: `dashboard/views/customer_profile.py`)
- Marketing / analysts → Streamlit app: uses dashboard
