| 1 |
FE |
Header.jsx |
Upload button click |
Opens UploadModal; shows active filename badge from localStorage |
— |
| 2 |
FE |
UploadModal.jsx |
handleUpload() |
Sends POST /api/upload with FormData; polls /api/upload/status every 2 s |
Filename stored in localStorage |
| 3 |
BE |
upload_server.py |
POST /api/upload |
Validates extension, saves .xlsx to _uploads/, spawns background thread |
{ ok: true, filename } |
| 4 |
BE |
upload_server.py |
_run_pipeline() |
Calls python -m pipeline.run --input file.xlsx --output output/ via subprocess.Popen (streams live) |
Terminal log |
| 5 |
PY |
pipeline/loader.py |
load_data() |
Reads sheet 1_Source_Data; computes Price = Value / Volume; drops nulls |
DataFrame |
| 6 |
PY |
pipeline/run.py |
read_brand_config() |
Reads sheet 2_Brand_Config; extracts focal brand + competitors |
brand config dict |
| 7 |
PY |
pipeline/modelling.py |
build_wide_pivot() |
One wide table per Channel × Region grain with focal + competitor columns |
wide DataFrame |
| 8 |
PY |
pipeline/diagnostics.py |
run_diagnostics() |
Pearson correlation, CV, RPI checks per grain; writes Excel diagnostics file |
*_Diagnostics.xlsx |
| 9 |
PY |
pipeline/modelling.py |
run_elasticity_models() |
OLS regression on all spec combos; selects best Adj-R² with correct sign; clamps to [−6, 0] |
results DataFrame |
| 10 |
PY |
pipeline/proxies.py |
assign_proxies() |
Wrong-sign grains borrow elasticity from adjacent/nearby grains |
final elasticities |
| 11 |
PY |
pipeline/exporters/stats.py |
export_stats() |
Writes elasticity results + brand KPIs |
models.json, stats.json, freq_anchors.json |
| 12 |
PY |
pipeline/exporters/market.py |
export_market() |
Writes time-series, market share, volume/value share |
trend.json, ms.json, vol_salience.json, val_share.json, comp_ms.json, vtm.json |
| 13 |
PY |
pipeline/exporters/ppa.py |
export_ppa() |
Reads sheets 3_PPA_MT and 4_PPA_TT from original xlsx |
ppa_mt.json, ppa_tt.json |
| 14 |
PY |
pipeline/exporters/analytics.py |
export_analytics() |
Cross-brand correlations, growth decomposition, price gradient index |
interaction.json, growth_decomp.json, pgi.json |
| 15 |
PY |
pipeline/exporters/recommendations.py |
export_recs() |
Builds pricing recommendation cards per pack using elasticities |
recs_full.json |
| 16 |
BE |
upload_server.py |
GET /api/data/{key} |
Reads output/{key}.json and returns as JSON response to React |
JSON to browser |
| 17 |
FE |
DataContext.jsx |
fetchKey() |
Tries /api/data/{key} first; falls back to /data/{key}.json (static) |
React state updated |
| 18 |
FE |
src/components/tabs/ |
All tab components |
Read from DataContext and render charts, tables, recommendation cards |
Dashboard UI |