# ipanpanpan/ecommerce-lifecycle-analytics architecture

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

- Interactive diagram: https://gitdiagram.com/ipanpanpan/ecommerce-lifecycle-analytics
- Repository: https://github.com/ipanpanpan/ecommerce-lifecycle-analytics

## Overview

This repository is an e-commerce lifecycle analytics project, not a deployed application. Its documented workflow queries BigQuery to produce RFM customer segments, cohort-retention metrics, and smoothed daily-revenue data; the resulting CSVs are loaded into a notebook for visualization and business insights. The graph preserves those three distinct analytical stages and their documented outputs. Source excerpts were unavailable, so relationships are based on the README’s architecture diagram and descriptions; the revenue-query details are only partially shown.

Main entry points: [`notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb`](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb) (Visualization Notebook), [`README.md`](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/README.md) (Business Insights), [`sql/01_rfm_segmentation.sql`](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/01_rfm_segmentation.sql) (RFM Segmentation), [`sql/02_cohort_retention.sql`](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/02_cohort_retention.sql) (Cohort Retention)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_queries["SQL Analytics"]
  node_rfm["RFM Segmentation"]
  node_cohort["Cohort Retention"]
  node_revenue["Rolling Revenue"]
end

subgraph group_datasets["Exported Data"]
  node_rfm_csv[("RFM Results")]
  node_cohort_csv[("Retention Results")]
  node_revenue_csv[("Revenue Results")]
end

subgraph group_presentation["Notebook Analysis"]
  node_notebook["Visualization Notebook"]
  node_rfm_viz["RFM Charts"]
  node_retention_viz["Retention Heatmap"]
  node_revenue_viz["Revenue Overlay"]
  node_insights["Business Insights<br/>[README.md]"]
end

node_bigquery[("BigQuery Dataset")]

node_bigquery -->|"query source"| node_rfm
node_bigquery -->|"query source"| node_cohort
node_bigquery -->|"query source"| node_revenue
node_rfm -->|"exports"| node_rfm_csv
node_cohort -->|"exports"| node_cohort_csv
node_revenue -->|"exports"| node_revenue_csv
node_rfm_csv -->|"loads data"| node_notebook
node_cohort_csv -->|"loads data"| node_notebook
node_revenue_csv -->|"loads data"| node_notebook
node_notebook -->|"renders"| node_rfm_viz
node_notebook -->|"renders"| node_retention_viz
node_notebook -->|"renders"| node_revenue_viz
node_rfm_viz -->|"informs"| node_insights
node_retention_viz -->|"informs"| node_insights
node_revenue_viz -->|"informs"| node_insights

click node_rfm "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/01_rfm_segmentation.sql"
click node_cohort "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/02_cohort_retention.sql"
click node_revenue "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/03_rolling_revenue.sql"
click node_rfm_csv "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/data/01_rfm_segmentation.csv"
click node_cohort_csv "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/data/02_cohort_retention.csv"
click node_revenue_csv "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/data/03_rolling_revenue.csv"
click node_notebook "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb"
click node_rfm_viz "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb"
click node_retention_viz "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb"
click node_revenue_viz "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb"
click node_insights "https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/README.md"

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_rfm,node_cohort,node_revenue toneBlue
class node_rfm_csv,node_cohort_csv,node_revenue_csv,node_bigquery toneAmber
class node_notebook,node_rfm_viz,node_retention_viz,node_revenue_viz,node_insights toneMint
```

## Components

### SQL Analytics

- [RFM Segmentation](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/01_rfm_segmentation.sql): `sql/01_rfm_segmentation.sql`
- [Cohort Retention](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/02_cohort_retention.sql): `sql/02_cohort_retention.sql`
- [Rolling Revenue](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/sql/03_rolling_revenue.sql): `sql/03_rolling_revenue.sql`

### Exported Data

- [RFM Results](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/data/01_rfm_segmentation.csv): `data/01_rfm_segmentation.csv`
- [Retention Results](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/data/02_cohort_retention.csv): `data/02_cohort_retention.csv`
- [Revenue Results](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/data/03_rolling_revenue.csv): `data/03_rolling_revenue.csv`

### Notebook Analysis

- [Visualization Notebook](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb): `notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb`
- [RFM Charts](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb): `notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb`
- [Retention Heatmap](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb): `notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb`
- [Revenue Overlay](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb): `notebooks/visualization-for-ecommerce-rfm-and-customer-ret.ipynb`
- [Business Insights](https://github.com/ipanpanpan/ecommerce-lifecycle-analytics/blob/main/README.md): `README.md`

### Other components

- **BigQuery Dataset**

## Connections

- BigQuery Dataset → RFM Segmentation: query source (evidence: `README.md`)
- BigQuery Dataset → Cohort Retention: query source (evidence: `README.md`)
- BigQuery Dataset → Rolling Revenue: query source (evidence: `README.md`)
- RFM Segmentation → RFM Results: exports (evidence: `README.md`)
- Cohort Retention → Retention Results: exports (evidence: `README.md`)
- Rolling Revenue → Revenue Results: exports (evidence: `README.md`)
- RFM Results → Visualization Notebook: loads data (evidence: `README.md`)
- Retention Results → Visualization Notebook: loads data (evidence: `README.md`)
- Revenue Results → Visualization Notebook: loads data (evidence: `README.md`)
- Visualization Notebook → RFM Charts: renders (evidence: `README.md`)
- Visualization Notebook → Retention Heatmap: renders (evidence: `README.md`)
- Visualization Notebook → Revenue Overlay: renders (evidence: `README.md`)
- RFM Charts → Business Insights: informs (evidence: `README.md`)
- Retention Heatmap → Business Insights: informs (evidence: `README.md`)
- Revenue Overlay → Business Insights: informs (evidence: `README.md`)
