# aditipokale1/dynamic-pricing-ecom architecture

> Architecture diagram of the GitHub repository aditipokale1/dynamic-pricing-ecom, 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/aditipokale1/dynamic-pricing-ecom
- Repository: https://github.com/aditipokale1/dynamic-pricing-ecom

## Overview

This is an end-to-end e-commerce dynamic-pricing workflow: synthetic SKU, traffic, price, sales, and inventory data feed SKU–segment–day features; a demand model and pricing rules evaluate candidate prices for expected profit; recommendations carry audit reason codes and feed run summaries and dashboard exports. The SQLite database is the shared state layer. The README documents the larger pipeline and dashboard capabilities; source excerpts show feature construction, guardrail behavior, recommendation orchestration, and summary aggregation. Some generator-to-generator and export wiring is not shown, so those links are omitted or cited as documented.

Main entry points: [`sql/schema.sql`](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/sql/schema.sql) (Pricing database), [`src/run_pricing_job.py`](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/run_pricing_job.py) (Recommendation job), [`src/build_features.py`](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/build_features.py) (Feature builder), [`src/build_run_summary.py`](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/build_run_summary.py) (Run summary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data generation"]
  node_sku["SKU dimensions"]
  node_inventory["Inventory facts"]
  node_traffic["Traffic facts"]
  node_shown_prices["Shown prices"]
  node_sales["Sales facts"]
  node_database[("Pricing database<br/>[schema.sql]")]
  node_features["Feature builder<br/>[build_features.py]"]
end

subgraph group_pricing["Pricing workflow"]
  node_demand_model["Demand model<br/>[run_pricing_job.py]"]
  node_pricing_job["Recommendation job<br/>[run_pricing_job.py]"]
  node_guardrails["Pricing guardrails<br/>[rules.py]"]
  node_objective["Profit objective<br/>[objective.py]"]
  node_single_demo["Single-price demo"]
end

subgraph group_monitoring["Monitoring and reporting"]
  node_summary["Run summary"]
  node_dashboard_export["Dashboard exports"]
  node_logged_export["Logged-price comparison"]
  node_dashboard["Power BI dashboard"]
end

node_operator(("Workflow operator"))

node_operator -.->|"runs"| node_sku
node_operator -.->|"runs"| node_inventory
node_operator -.->|"runs"| node_traffic
node_operator -.->|"runs"| node_shown_prices
node_operator -.->|"runs"| node_sales
node_operator -.->|"runs"| node_features
node_operator -.->|"runs"| node_pricing_job
node_operator -.->|"runs"| node_summary
node_sku -.->|"writes dimensions"| node_database
node_inventory -->|"writes facts"| node_database
node_traffic -->|"writes facts"| node_database
node_shown_prices -->|"writes prices"| node_database
node_sales -->|"writes sales"| node_database
node_database -->|"provides joined rows"| node_features
node_features -->|"writes features"| node_database
node_database -->|"supplies pricing inputs"| node_pricing_job
node_pricing_job -->|"trains and predicts"| node_demand_model
node_pricing_job -->|"applies rules"| node_guardrails
node_pricing_job -->|"scores profit"| node_objective
node_pricing_job -->|"stores recommendations"| node_database
node_single_demo -->|"applies rules"| node_guardrails
node_single_demo -->|"scores profit"| node_objective
node_database -->|"reads recommendations"| node_summary
node_summary -->|"writes aggregates"| node_database
node_database -.->|"provides monitoring data"| node_dashboard_export
node_dashboard_export -.->|"feeds dashboard"| node_dashboard
node_database -.->|"provides comparison data"| node_logged_export

click node_sku "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_dim_sku.py"
click node_inventory "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_inventory.py"
click node_traffic "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_traffic.py"
click node_shown_prices "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_prices_shown.py"
click node_sales "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_sales.py"
click node_database "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/sql/schema.sql"
click node_features "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/build_features.py"
click node_demand_model "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/run_pricing_job.py"
click node_pricing_job "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/run_pricing_job.py"
click node_guardrails "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/pricing/rules.py"
click node_objective "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/pricing/objective.py"
click node_single_demo "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/pricing/demo_recommend_one_price.py"
click node_summary "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/build_run_summary.py"
click node_dashboard_export "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/export_for_dashboard.py"
click node_logged_export "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/export_reco_vs_logged.py"
click node_dashboard "https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/dashboards/exports/DynamicPricing_Ecom.pbix"

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_sku,node_inventory,node_traffic,node_shown_prices,node_sales,node_database,node_features toneBlue
class node_demand_model,node_pricing_job,node_guardrails,node_objective,node_single_demo toneAmber
class node_summary,node_dashboard_export,node_logged_export,node_dashboard toneMint
class node_operator toneIndigo
```

## Components

### Data generation

- [SKU dimensions](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_dim_sku.py): `src/generate_dim_sku.py`
- [Inventory facts](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_inventory.py): `src/generate_fact_inventory.py`
- [Traffic facts](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_traffic.py): `src/generate_fact_traffic.py`
- [Shown prices](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_prices_shown.py): `src/generate_fact_prices_shown.py`
- [Sales facts](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/generate_fact_sales.py): `src/generate_fact_sales.py`
- [Pricing database](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/sql/schema.sql): `sql/schema.sql`
- [Feature builder](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/build_features.py): `src/build_features.py`

### Pricing workflow

- [Demand model](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/run_pricing_job.py): `src/run_pricing_job.py`
- [Recommendation job](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/run_pricing_job.py): `src/run_pricing_job.py`
- [Pricing guardrails](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/pricing/rules.py): `src/pricing/rules.py`
- [Profit objective](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/pricing/objective.py): `src/pricing/objective.py`
- [Single-price demo](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/pricing/demo_recommend_one_price.py): `src/pricing/demo_recommend_one_price.py`

### Monitoring and reporting

- [Run summary](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/build_run_summary.py): `src/build_run_summary.py`
- [Dashboard exports](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/export_for_dashboard.py): `src/export_for_dashboard.py`
- [Logged-price comparison](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/src/export_reco_vs_logged.py): `src/export_reco_vs_logged.py`
- [Power BI dashboard](https://github.com/aditipokale1/dynamic-pricing-ecom/blob/main/dashboards/exports/DynamicPricing_Ecom.pbix): `dashboards/exports/DynamicPricing_Ecom.pbix`

### Other components

- **Workflow operator**

## Connections

- Workflow operator → SKU dimensions: runs
- Workflow operator → Inventory facts: runs
- Workflow operator → Traffic facts: runs
- Workflow operator → Shown prices: runs
- Workflow operator → Sales facts: runs
- Workflow operator → Feature builder: runs
- Workflow operator → Recommendation job: runs
- Workflow operator → Run summary: runs
- SKU dimensions → Pricing database: writes dimensions
- Inventory facts → Pricing database: writes facts (evidence: `src/generate_fact_inventory.py`)
- Traffic facts → Pricing database: writes facts (evidence: `src/generate_fact_traffic.py`)
- Shown prices → Pricing database: writes prices (evidence: `src/generate_fact_prices_shown.py`)
- Sales facts → Pricing database: writes sales (evidence: `src/generate_fact_sales.py`)
- Pricing database → Feature builder: provides joined rows (evidence: `src/build_features.py`)
- Feature builder → Pricing database: writes features (evidence: `src/build_features.py`)
- Pricing database → Recommendation job: supplies pricing inputs (evidence: `src/run_pricing_job.py`)
- Recommendation job → Demand model: trains and predicts (evidence: `src/run_pricing_job.py`)
- Recommendation job → Pricing guardrails: applies rules (evidence: `src/run_pricing_job.py`)
- Recommendation job → Profit objective: scores profit (evidence: `src/run_pricing_job.py`)
- Recommendation job → Pricing database: stores recommendations (evidence: `README.md`)
- Single-price demo → Pricing guardrails: applies rules (evidence: `src/pricing/demo_recommend_one_price.py`)
- Single-price demo → Profit objective: scores profit (evidence: `src/pricing/demo_recommend_one_price.py`)
- Pricing database → Run summary: reads recommendations (evidence: `src/build_run_summary.py`)
- Run summary → Pricing database: writes aggregates (evidence: `src/build_run_summary.py`)
- Pricing database → Dashboard exports: provides monitoring data (evidence: `README.md`)
- Dashboard exports → Power BI dashboard: feeds dashboard (evidence: `README.md`)
- Pricing database → Logged-price comparison: provides comparison data (evidence: `README.md`)
