dashboard: JTBD-driven restructure — Pulse, Supply, Positioning, Warehouse
Replace monolithic Overview (8 charts, 24 metric cards, no filters) with
a JTBD-driven 5-page dashboard optimised for the data-drop moment.
Navigation (sidebar + mobile nav):
- Pulse /dashboard/ — full-picture overview, 10-second read
- Supply /dashboard/supply — USDA WASDE deep dive, range + metric filters
- Positioning /dashboard/positioning — KC=F price + CFTC COT, range filter
- Warehouse /dashboard/warehouse — ICE certified stocks, range + view filters
- Origins /dashboard/countries — unchanged (HTMX already live)
- Settings — unchanged
New templates:
- pulse.html: 4 metric cards + freshness bar + 2×2 sparkline grid
- supply.html + supply_canvas.html: HTMX partial with 5Y/10Y/Max and
Production/Exports/Imports/Stocks filter pills; free plan gated at 5Y
- positioning.html + positioning_canvas.html: price chart + COT dual-axis;
client-side MA toggles (no server round-trip)
- warehouse.html + warehouse_canvas.html: Daily Stocks / Aging / By Port
view switcher; only active view's queries fire
routes.py:
- RANGE_MAP dict maps URL param → {days, weeks, months, years}
- _safe() helper absorbs asyncio.gather exceptions with defaults
- index() rewritten: 8 lightweight queries, renders pulse.html
- supply(), positioning(), warehouse() routes added; HX-Request detection
returns canvas partial; full request returns page shell
input.css:
- All cc-* component classes moved from countries.html inline style to
global stylesheet (cc-chart-card, cc-trow 3-col grid, cc-empty, etc.)
- filter-bar, filter-pills, filter-pill, canvas-loading, freshness-badge
- cc-chart-body canvas max-height 340px (prevents gigantic charts on 4K)
_feedback_widget.html:
- Mobile: collapses to circular icon button at bottom:72px to clear 5-item
nav bar; "Feedback" label hidden on mobile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,13 +57,13 @@ We move fast, ship incrementally, and prioritize value over vanity metrics.
|
||||
|
||||
**Languages:**
|
||||
- SQL (primary transformation language)
|
||||
- Python (orchestration, extraction, APIs)
|
||||
- Python (Web,orchestration, extraction, APIs)
|
||||
- C (performance-critical extensions)
|
||||
|
||||
**Infrastructure:**
|
||||
- **Storage:** Cloudflare R2 (not S3)
|
||||
- **Compute:** Hetzner bare metal (not AWS/GCP)
|
||||
- **Database:** DuckDB (not Spark/Snowflake)
|
||||
- **Storage:** Baremetal nvme drives (backup cloudflare r2)
|
||||
- **Compute:** Hetzner bare metal (not AWS/GCP, maybe later for ephemeral pipelines if needed)
|
||||
- **Database:** Sqlite/DuckDB
|
||||
- **Orchestration:** SQLMesh + custom Python (not Airflow)
|
||||
|
||||
**Development:**
|
||||
|
||||
Reference in New Issue
Block a user