“What changed in recorded revenue, which transactions explain that change, and how sensitive is the result to our assumptions?”
TRACE is a retail revenue investigation lab built with React, TypeScript, DuckDB-Wasm, and Python. It transforms 1,067,371 historical transaction records into an auditable, interactive analytics workspace where any chart variance leads directly to the underlying transaction evidence, analytical SQL, and inclusion governance rules.
Designed for a first-year BCA Data Analytics portfolio demonstrating deep analytical judgment, denominator discipline, reproducible data engineering, and zero-paid-service client architecture.
Recorded revenue timeline, 4 top-line KPIs, and variance decomposition waterfall bridge.
Auditable transaction ledger and in-browser SQL Calculation Drawer powered by DuckDB-Wasm.
| Capability | Engineering & Analytical Substance |
|---|---|
| Reproducible Source-to-Parquet | Python, Pandas, and PyArrow pipeline ingests the official UCI Online Retail II raw Excel sheets, computes SHA-256 manifests, and exports compact columnar Parquet. |
| In-Browser Analytical SQL | DuckDB-Wasm runs in a dedicated Web Worker, executing complex analytical SQL directly in the client with sub-50ms warm filter query latencies. |
| 100% Reconciliation Invariant | Mutually exclusive disposition buckets (POS_SALE, CANCELLATION, INVALID_PRICE, NON_MERCH) reconcile exactly to the 1,067,371 raw source records. |
| Variance Decomposition Bridge | Additive current-minus-prior revenue variance decomposed by country or product with an explicit "Other" bucket guaranteeing penny-perfect reconciliation. |
| Denominator Discipline | 22.77% of rows lack Customer IDs. Preserved in Gross/Net revenue totals (guest checkouts) but strictly excluded from customer retention denominators. |
| Customer RFM & Retention Cohorts | Quintile RFM segmentation and monthly acquisition cohort heatmaps distinguishing unobserved future periods from observed 0% repeat rates. |
| Transparent What-If Scenarios | Relative cancellation reduction sensitivity slider ( |
| Zero-Paid-Service Architecture | Zero runtime APIs, no backend database bill, no credit card required. Universal static deployment to GitHub Pages. |
[ UCI Online Retail II: 1,067,371 rows across 2 Excel Sheets ]
│
▼ (Python + Pandas + PyArrow)
[ pipeline/prepare_data.py: Normalization, Classification & SHA-256 Manifest ]
│
├──────────────────────────┐
▼ ▼
public/data/trace_demo.parquet public/data/trace_full.parquet
(224,250 rows • 1.51 MB) (1,067,371 rows • 7.46 MB)
│
▼ (Client Browser Web Worker)
[ DuckDB-Wasm Engine (Non-Threaded EH Bundle) ]
│
▼ (Parameterized SQL Registry: sql/queries.ts)
┌──────────────────┼──────────────────┬──────────────────┐
▼ ▼ ▼ ▼
Overview View Investigate View Customers View Scenarios View
(Timeline/Bridge) (Evidence & SQL) (Cohorts & RFM) (What-If Sensitivity)
- Node.js: v18+ (tested on Node v24.14.1)
- PowerShell / Bash
- Python: Optional (only required to rebuild Parquet from raw UCI Excel; shipped demo Parquet runs immediately without Python).
# Clone or open project directory
cd d:\Ran\trace
# Install dependencies
npm installnpm run devOpen http://localhost:5173 in your browser.
npm run build
npm run previewOpen http://localhost:4173.
npm run testExecutes 8 automated contract verification tests in tests/metric_contract.test.js.
To regenerate the Parquet assets from the official UCI Machine Learning Repository:
# Using uv (recommended fast standalone runner):
uv run --with pandas --with duckdb --with pyarrow --with openpyxl python pipeline/prepare_data.py
# Or using standard python:
pip install pandas duckdb pyarrow openpyxl requests
python pipeline/prepare_data.pyTRACE is configured with base: './' in vite.config.ts, making it deployable to GitHub Pages or any static web host without custom server configurations.
- Push this repository to GitHub.
- In GitHub repository settings, navigate to Pages.
- Under Build and deployment, select GitHub Actions and use the standard static Vite deployment workflow, or run:
and deploy the
npm run build
dist/folder to thegh-pagesbranch.
- Source Dataset: Online Retail II
- Repository: UCI Machine Learning Repository
- DOI: 10.24432/C5CG6D
- License: Creative Commons Attribution 4.0 International (CC BY 4.0)
- Attribution Statement: The source data reflects real transactions from a UK-based online gifts and homewares retailer between 01/12/2009 and 09/12/2011. Prices are in British Pounds (GBP / £).