# ahmedbakr78/web-to-warehouse-product-intelligence-pipeline architecture

> Architecture diagram of the GitHub repository ahmedbakr78/web-to-warehouse-product-intelligence-pipeline, 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/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline
- Repository: https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline

## Overview

This is a web-to-warehouse product intelligence system: it harvests permitted public product sources, normalizes and deduplicates records, loads an analytical warehouse, evaluates data quality, and serves results through a REST API and React dashboard. Users can explore analytics and forecasts, manage pipeline runs, and use reports, exports, alerts, and webhooks. The graph emphasizes the documented pipeline and sampled runtime relationships; some dashboard and API capability links are based on the README because their implementation files were not sampled.

Main entry points: [`app/etl/pipeline.py`](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/etl/pipeline.py) (ETL orchestrator), [`app/api/main.py`](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/api/main.py) (REST API), [`frontend/src/App.tsx`](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/frontend/src/App.tsx) (React dashboard), [`app/ingestion/base.py`](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/base.py) (Ingestion contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Compliant ingestion"]
  node_source_adapters["Source adapters"]
  node_ingestion_contract["Ingestion contract<br/>[base.py]"]
  node_compliant_transport["Compliant transport<br/>[http_client.py]"]
end

subgraph group_warehouse["ETL and warehouse"]
  node_cleaning["Normalization<br/>[cleaning.py]"]
  node_dedupe["Fuzzy deduplication<br/>[dedupe.py]"]
  node_pipeline["ETL orchestrator<br/>[pipeline.py]"]
  node_loader["Warehouse loader<br/>[loader.py]"]
  node_dq["Data quality<br/>[dq.py]"]
  node_warehouse_db[("Analytical warehouse<br/>[facts.py]")]
end

subgraph group_serve["API and analytics"]
  node_api["REST API<br/>[main.py]"]
  node_analytics["Analytics service<br/>[service.py]"]
  node_forecast["Forecasting<br/>[forecast.py]"]
  node_webhooks["Webhook delivery<br/>[webhooks.py]"]
end

subgraph group_ui["Dashboard"]
  node_frontend["React dashboard<br/>[App.tsx]"]
  node_dashboard_pages["Analytics and pipeline screens<br/>[Analytics.tsx]"]
end

subgraph group_ops["Orchestration and operations"]
  node_database_runtime["Database sessions<br/>[db.py]"]
  node_airflow["Airflow DAG"]
  node_jobs["Background jobs<br/>[handlers.py]"]
  node_user_data[("User and operations state<br/>[app_users.py]")]
end

node_user(("Analyst or operator"))
node_web_sources(("Public product sources"))

node_user -->|"explores data"| node_frontend
node_frontend -->|"requests results"| node_api
node_web_sources -->|"provides products"| node_source_adapters
node_source_adapters -->|"implements contract"| node_ingestion_contract
node_ingestion_contract -->|"uses transport"| node_compliant_transport
node_compliant_transport -->|"fetches politely"| node_web_sources
node_pipeline -->|"extracts records"| node_ingestion_contract
node_pipeline -->|"transforms records"| node_cleaning
node_pipeline -->|"resolves duplicates"| node_dedupe
node_pipeline -->|"loads records"| node_loader
node_pipeline -->|"measures quality"| node_dq
node_loader -->|"writes facts"| node_warehouse_db
node_dq -->|"persists verdicts"| node_warehouse_db
node_pipeline -->|"opens sessions"| node_database_runtime
node_airflow -->|"orchestrates runs"| node_pipeline
node_api -->|"triggers pipeline"| node_pipeline
node_api -->|"serves analytics"| node_analytics
node_analytics -->|"queries warehouse"| node_warehouse_db
node_api -.->|"dispatches work"| node_jobs
node_jobs -->|"runs pipeline"| node_pipeline
node_api -->|"manages webhooks"| node_webhooks
node_webhooks -->|"records deliveries"| node_user_data
node_frontend -->|"routes screens"| node_dashboard_pages
node_dashboard_pages -->|"loads dashboard data"| node_api
node_api -->|"uses account state"| node_user_data
node_api -.->|"serves forecasts"| node_forecast

click node_source_adapters "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/tree/main/app/ingestion/sources"
click node_ingestion_contract "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/base.py"
click node_compliant_transport "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/http_client.py"
click node_cleaning "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/cleaning.py"
click node_dedupe "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/dedupe.py"
click node_pipeline "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/etl/pipeline.py"
click node_loader "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/etl/loader.py"
click node_dq "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/etl/dq.py"
click node_warehouse_db "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/models/facts.py"
click node_database_runtime "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/core/db.py"
click node_airflow "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/dags/product_intelligence_pipeline.py"
click node_api "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/api/main.py"
click node_analytics "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/analytics/service.py"
click node_forecast "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/analytics/forecast.py"
click node_jobs "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/jobs/handlers.py"
click node_webhooks "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/services/webhooks.py"
click node_user_data "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/models/app_users.py"
click node_frontend "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/frontend/src/App.tsx"
click node_dashboard_pages "https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/frontend/src/pages/Analytics.tsx"

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_source_adapters,node_ingestion_contract,node_compliant_transport toneBlue
class node_cleaning,node_dedupe,node_pipeline,node_loader,node_dq,node_warehouse_db toneAmber
class node_api,node_analytics,node_forecast,node_webhooks toneMint
class node_frontend,node_dashboard_pages toneRose
class node_database_runtime,node_airflow,node_jobs,node_user_data,node_user,node_web_sources toneIndigo
```

## Components

### Compliant ingestion

- [Source adapters](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/tree/main/app/ingestion/sources): `app/ingestion/sources`
- [Ingestion contract](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/base.py): `app/ingestion/base.py`
- [Compliant transport](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/http_client.py): `app/ingestion/http_client.py`

### ETL and warehouse

- [Normalization](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/cleaning.py): `app/ingestion/cleaning.py`
- [Fuzzy deduplication](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/ingestion/dedupe.py): `app/ingestion/dedupe.py`
- [ETL orchestrator](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/etl/pipeline.py): `app/etl/pipeline.py`
- [Warehouse loader](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/etl/loader.py): `app/etl/loader.py`
- [Data quality](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/etl/dq.py): `app/etl/dq.py`
- [Analytical warehouse](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/models/facts.py): `app/models/facts.py`

### API and analytics

- [REST API](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/api/main.py): `app/api/main.py`
- [Analytics service](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/analytics/service.py): `app/analytics/service.py`
- [Forecasting](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/analytics/forecast.py): `app/analytics/forecast.py`
- [Webhook delivery](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/services/webhooks.py): `app/services/webhooks.py`

### Dashboard

- [React dashboard](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Analytics and pipeline screens](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/frontend/src/pages/Analytics.tsx): `frontend/src/pages/Analytics.tsx`

### Orchestration and operations

- [Database sessions](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/core/db.py): `app/core/db.py`
- [Airflow DAG](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/dags/product_intelligence_pipeline.py): `dags/product_intelligence_pipeline.py`
- [Background jobs](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/jobs/handlers.py): `app/jobs/handlers.py`
- [User and operations state](https://github.com/ahmedbakr78/web-to-warehouse-product-intelligence-pipeline/blob/main/app/models/app_users.py): `app/models/app_users.py`

### Other components

- **Analyst or operator**
- **Public product sources**

## Connections

- Analyst or operator → React dashboard: explores data (evidence: `README.md`)
- React dashboard → REST API: requests results (evidence: `README.md`)
- Public product sources → Source adapters: provides products (evidence: `README.md`)
- Source adapters → Ingestion contract: implements contract (evidence: `app/ingestion/base.py`)
- Ingestion contract → Compliant transport: uses transport (evidence: `app/ingestion/base.py`)
- Compliant transport → Public product sources: fetches politely (evidence: `README.md`)
- ETL orchestrator → Ingestion contract: extracts records (evidence: `app/etl/pipeline.py`)
- ETL orchestrator → Normalization: transforms records (evidence: `app/etl/pipeline.py`)
- ETL orchestrator → Fuzzy deduplication: resolves duplicates (evidence: `app/etl/pipeline.py`)
- ETL orchestrator → Warehouse loader: loads records (evidence: `app/etl/pipeline.py`)
- ETL orchestrator → Data quality: measures quality (evidence: `app/etl/pipeline.py`)
- Warehouse loader → Analytical warehouse: writes facts (evidence: `app/etl/loader.py`)
- Data quality → Analytical warehouse: persists verdicts (evidence: `app/etl/dq.py`)
- ETL orchestrator → Database sessions: opens sessions (evidence: `app/etl/pipeline.py`)
- Airflow DAG → ETL orchestrator: orchestrates runs (evidence: `dags/product_intelligence_pipeline.py`)
- REST API → ETL orchestrator: triggers pipeline
- REST API → Analytics service: serves analytics
- Analytics service → Analytical warehouse: queries warehouse (evidence: `README.md`)
- REST API → Background jobs: dispatches work
- Background jobs → ETL orchestrator: runs pipeline (evidence: `app/jobs/handlers.py`)
- REST API → Webhook delivery: manages webhooks
- Webhook delivery → User and operations state: records deliveries (evidence: `app/services/webhooks.py`)
- React dashboard → Analytics and pipeline screens: routes screens (evidence: `frontend/src/App.tsx`)
- Analytics and pipeline screens → REST API: loads dashboard data (evidence: `README.md`)
- REST API → User and operations state: uses account state
- REST API → Forecasting: serves forecasts
