You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0a13f97
Browse filesBrowse the repository at this point in the historyBrowse files
Deploy the Dash app to Fly.io and document both front-ends
- Dockerfile.dash excludes PySpark entirely; the app reads the pre-built
Gold parquet, so no JVM ships in the image
- .dockerignore keeps venv, docs and the Spark jobs out of the build context
- fly.toml pins London, keeps one machine warm (min_machines_running = 1)
so the demo link never opens on a cold start, and health-checks /
- README gains a Live Dash App section, kept below the static report, which
stays the headline because it always loads
Image builds and serves: HTTP 200, 26 ms median callback round trip.
@@ -299,6 +313,47 @@ Writes `dashboards/executive_dashboard.html` and `docs/index.html` (the GitHub P
299
313
300
314
---
301
315
316
+
# 🖥️ Live Dash App
317
+
318
+
The same report, served by Python instead of precomputed into a file — a **Dash** app in `app/`, deployed to Fly.io.
319
+
320
+
Why both? A static file can only answer questions it was built to answer. The eight filters combine into **1.6 billion** possible selections, so precomputing them all is impossible; the static build embeds the fact rows and aggregates them in the browser instead. The Dash app aggregates the same rows in pandas, per request. Two answers to the same constraint, and the contrast is the point:
321
+
322
+
|| Static report | Dash app |
323
+
|---|---|---|
324
+
| Aggregation | JavaScript, in the browser | pandas, on the server |
325
+
| Delivery | one file, opens offline | a running process |
326
+
| Hosting | GitHub Pages | Fly.io |
327
+
| Filter response |~70 ms |~26 ms compute + round trip |
The two front-ends look identical because they read the same sources, not because anyone kept them in sync by hand:
333
+
334
+
-**`dashboards/assets/app.css`** — Dash serves this folder directly, so both use one stylesheet
335
+
-**`shared/chart_theme.json`** — bar radius, gaps, margins, tick formats
336
+
-**Colours** — declared once as CSS custom properties; `app.js` reads them via `getComputedStyle`, `app/theme.py` parses the same declarations
337
+
-**`data/gold/analytics_facts.parquet`** — the cleaned fact table both consume (1.6 MB, loads in 9 ms)
338
+
339
+
The only deliberate duplication is trace assembly: ~150 lines of `app/figures.py` mirroring `app.js`, which no amount of sharing can avoid across two languages.
340
+
341
+
### Running it
342
+
343
+
```bash
344
+
pip install -r app/requirements.txt
345
+
python run_dash.py # http://localhost:8050
346
+
```
347
+
348
+
The Docker image excludes PySpark entirely — the app reads the pre-built parquet, so it needs no JVM at runtime.
0 commit comments