# hsdsp9-ship-it/brightcart-capstone architecture

> Architecture diagram of the GitHub repository hsdsp9-ship-it/brightcart-capstone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hsdsp9-ship-it/brightcart-capstone
- Repository: https://github.com/hsdsp9-ship-it/brightcart-capstone

## Overview

BrightCart is a Databricks retail analytics capstone. Its principal workflow generates or receives order data, ingests batch and incremental files into Bronze, enriches and upserts orders in Silver, aggregates business metrics in Gold, and presents analytics in a report. Separate branches provide raw-data profiling and streaming ingestion. The excerpts establish most batch and streaming data movements; the report’s exact Gold-table inputs and email dispatch are not fully shown, so those links are left unasserted.

Main entry points: [`notebooks/config.py`](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/config.py) (Notebook configuration), [`notebooks/06_streaming_silver_gold.py`](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/06_streaming_silver_gold.py) (Streaming enrichment), [`notebooks/02_bronze_ingestion.py`](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/02_bronze_ingestion.py) (Batch Bronze), [`notebooks/05_autoloader_ingestion.py`](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/05_autoloader_ingestion.py) (Auto Loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Data Inputs"]
  node_generator["Synthetic data"]
  node_dailygen["Daily orders"]
  node_rawfiles[("Raw CSV volumes")]
  node_profiling["Data profiling<br/>[01_explore.py]"]
end

subgraph group_batch["Batch Analytics"]
  node_bronze_batch["Batch Bronze"]
  node_bronze_tables[("Bronze Delta tables")]
  node_silver_batch["Silver enrichment"]
  node_silver_table[("Enriched Silver")]
  node_gold_aggregation["Gold aggregation"]
  node_gold_tables[("Gold Delta tables")]
end

subgraph group_stream["Streaming Analytics"]
  node_autoloader["Auto Loader"]
  node_bronze_stream[("Streaming Bronze")]
  node_stream_enrichment["Streaming enrichment"]
  node_silver_stream[("Streaming Silver")]
end

subgraph group_insights["Business Insights"]
  node_report["Business report"]
  node_report_artifact["HTML report"]
end

subgraph group_shared["Shared Runtime"]
  node_configuration["Notebook configuration<br/>[config.py]"]
  node_logging["Notebook logging<br/>[logging_helper.py]"]
end

node_analyst(("Analytics user"))

node_analyst -->|"starts generation"| node_generator
node_generator -->|"writes CSVs"| node_rawfiles
node_analyst -->|"creates daily batch"| node_dailygen
node_dailygen -->|"drops order files"| node_rawfiles
node_rawfiles -->|"profiles inputs"| node_profiling
node_rawfiles -->|"reads CSVs"| node_bronze_batch
node_bronze_batch -->|"writes Delta"| node_bronze_tables
node_bronze_tables -->|"loads Bronze"| node_silver_batch
node_silver_batch -->|"writes enriched orders"| node_silver_table
node_silver_table -->|"loads Silver"| node_gold_aggregation
node_gold_aggregation -->|"writes aggregates"| node_gold_tables
node_rawfiles -->|"watches incoming orders"| node_autoloader
node_autoloader -->|"writes stream table"| node_bronze_stream
node_bronze_stream -->|"reads order stream"| node_stream_enrichment
node_bronze_tables -->|"loads dimensions"| node_stream_enrichment
node_stream_enrichment -->|"MERGE upserts"| node_silver_stream
node_silver_stream -.->|"optionally combines stream data"| node_gold_aggregation
node_analyst -->|"views analysis"| node_report
node_report -->|"writes HTML"| node_report_artifact
node_bronze_batch -->|"gets paths"| node_configuration
node_silver_batch -->|"gets table names"| node_configuration
node_gold_aggregation -->|"gets table names"| node_configuration
node_autoloader -->|"gets stream paths"| node_configuration
node_stream_enrichment -->|"gets stream paths"| node_configuration
node_generator -->|"gets volume paths"| node_configuration
node_bronze_batch -->|"gets logger"| node_logging
node_autoloader -->|"gets logger"| node_logging
node_stream_enrichment -->|"gets logger"| node_logging

click node_generator "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/00_data_generation.py"
click node_dailygen "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/08_daily_data_generator.py"
click node_profiling "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/01_explore.py"
click node_bronze_batch "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/02_bronze_ingestion.py"
click node_silver_batch "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/03_silver_enrichment.py"
click node_gold_aggregation "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/04_gold_aggregation.py"
click node_autoloader "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/05_autoloader_ingestion.py"
click node_stream_enrichment "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/06_streaming_silver_gold.py"
click node_report "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/07_business_analytics_report.py"
click node_configuration "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/config.py"
click node_logging "https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/logging_helper.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,node_dailygen,node_rawfiles,node_profiling,node_analyst toneBlue
class node_bronze_batch,node_bronze_tables,node_silver_batch,node_silver_table,node_gold_aggregation,node_gold_tables toneAmber
class node_autoloader,node_bronze_stream,node_stream_enrichment,node_silver_stream toneMint
class node_report,node_report_artifact toneRose
class node_configuration,node_logging toneIndigo
```

## Components

### Data Inputs

- [Synthetic data](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/00_data_generation.py): `notebooks/00_data_generation.py`
- [Daily orders](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/08_daily_data_generator.py): `notebooks/08_daily_data_generator.py`
- **Raw CSV volumes**
- [Data profiling](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/01_explore.py): `notebooks/01_explore.py`

### Batch Analytics

- [Batch Bronze](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/02_bronze_ingestion.py): `notebooks/02_bronze_ingestion.py`
- **Bronze Delta tables**
- [Silver enrichment](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/03_silver_enrichment.py): `notebooks/03_silver_enrichment.py`
- **Enriched Silver**
- [Gold aggregation](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/04_gold_aggregation.py): `notebooks/04_gold_aggregation.py`
- **Gold Delta tables**

### Streaming Analytics

- [Auto Loader](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/05_autoloader_ingestion.py): `notebooks/05_autoloader_ingestion.py`
- **Streaming Bronze**
- [Streaming enrichment](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/06_streaming_silver_gold.py): `notebooks/06_streaming_silver_gold.py`
- **Streaming Silver**

### Business Insights

- [Business report](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/07_business_analytics_report.py): `notebooks/07_business_analytics_report.py`
- **HTML report**

### Shared Runtime

- [Notebook configuration](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/config.py): `notebooks/config.py`
- [Notebook logging](https://github.com/hsdsp9-ship-it/brightcart-capstone/blob/main/notebooks/logging_helper.py): `notebooks/logging_helper.py`

### Other components

- **Analytics user**

## Connections

- Analytics user → Synthetic data: starts generation (evidence: `README.md`)
- Synthetic data → Raw CSV volumes: writes CSVs (evidence: `README.md`)
- Analytics user → Daily orders: creates daily batch (evidence: `notebooks/08_daily_data_generator.py`)
- Daily orders → Raw CSV volumes: drops order files (evidence: `notebooks/08_daily_data_generator.py`)
- Raw CSV volumes → Data profiling: profiles inputs (evidence: `notebooks/01_explore.py`)
- Raw CSV volumes → Batch Bronze: reads CSVs (evidence: `notebooks/02_bronze_ingestion.py`)
- Batch Bronze → Bronze Delta tables: writes Delta (evidence: `README.md`)
- Bronze Delta tables → Silver enrichment: loads Bronze (evidence: `notebooks/03_silver_enrichment.py`)
- Silver enrichment → Enriched Silver: writes enriched orders (evidence: `notebooks/03_silver_enrichment.py`)
- Enriched Silver → Gold aggregation: loads Silver (evidence: `notebooks/04_gold_aggregation.py`)
- Gold aggregation → Gold Delta tables: writes aggregates (evidence: `README.md`)
- Raw CSV volumes → Auto Loader: watches incoming orders (evidence: `notebooks/05_autoloader_ingestion.py`)
- Auto Loader → Streaming Bronze: writes stream table (evidence: `notebooks/05_autoloader_ingestion.py`)
- Streaming Bronze → Streaming enrichment: reads order stream (evidence: `notebooks/06_streaming_silver_gold.py`)
- Bronze Delta tables → Streaming enrichment: loads dimensions (evidence: `notebooks/06_streaming_silver_gold.py`)
- Streaming enrichment → Streaming Silver: MERGE upserts (evidence: `notebooks/06_streaming_silver_gold.py`)
- Streaming Silver → Gold aggregation: optionally combines stream data (evidence: `notebooks/04_gold_aggregation.py`)
- Analytics user → Business report: views analysis (evidence: `README.md`)
- Business report → HTML report: writes HTML (evidence: `notebooks/07_business_analytics_report.py`)
- Batch Bronze → Notebook configuration: gets paths (evidence: `notebooks/02_bronze_ingestion.py`)
- Silver enrichment → Notebook configuration: gets table names (evidence: `notebooks/03_silver_enrichment.py`)
- Gold aggregation → Notebook configuration: gets table names (evidence: `notebooks/04_gold_aggregation.py`)
- Auto Loader → Notebook configuration: gets stream paths (evidence: `notebooks/05_autoloader_ingestion.py`)
- Streaming enrichment → Notebook configuration: gets stream paths (evidence: `notebooks/06_streaming_silver_gold.py`)
- Synthetic data → Notebook configuration: gets volume paths (evidence: `notebooks/00_data_generation.py`)
- Batch Bronze → Notebook logging: gets logger (evidence: `notebooks/02_bronze_ingestion.py`)
- Auto Loader → Notebook logging: gets logger (evidence: `notebooks/05_autoloader_ingestion.py`)
- Streaming enrichment → Notebook logging: gets logger (evidence: `notebooks/06_streaming_silver_gold.py`)
