- Fix pipeline granularity: add market_year to cleaned/serving SQL models - Add DuckDB data access layer with async query functions (analytics.py) - Build Chart.js dashboard: supply/demand, STU ratio, top producers, YoY table - Add country comparison page with multi-select picker - Replace items CRUD with read-only commodity API (list, metrics, countries, CSV) - Configure BeanFlows plan tiers (Free/Starter/Pro) with feature gating - Rewrite public pages for coffee market intelligence positioning - Remove boilerplate items schema, update health check for DuckDB - Add test suite: 139 tests passing (dashboard, API, billing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.2 KiB
2.2 KiB
Changelog
All notable changes to BeanFlows are documented here.
[Unreleased]
Added
- Coffee analytics dashboard — Chart.js visualizations for global supply/demand time series, stock-to-use ratio trend, top producing countries bar chart, and YoY production change table
- Country comparison page — Multi-select country picker with metric selector and overlay line chart at
/dashboard/countries - DuckDB data access layer (
web/src/beanflows/analytics.py) — Async bridge to read-only DuckDB viaasyncio.to_thread()with 7 domain query functions and metric allowlist for injection prevention - Commodity REST API —
GET /api/v1/commodities,/commodities/<code>/metrics,/commodities/<code>/countries,/commodities/<code>/metrics.csv(CSV export) - BeanFlows plan tiers — Free (coffee, 5yr history), Starter (full history, CSV, API), Pro (all 65 commodities, unlimited API)
- Landing, features, and pricing pages rewritten for coffee market intelligence positioning
- Health check now verifies both SQLite and DuckDB connectivity
- Admin panel shows commodity count and data year range from DuckDB
- Docker config updated with DuckDB volume mount
- Tests —
test_dashboard.py(8 tests),test_api_commodities.py(8 tests), analytics mock fixture in conftest
Fixed
- Pipeline time granularity — Added
market_yearto GROUP BY incleaned.psdalldata__commodity_pivotedand carried through toserving.commodity_metrics. Previously summed across all market years, making per-year metrics meaningless.
Removed
itemstable, FTS virtual table, and triggers from schema (boilerplate domain entity)- Items CRUD from API routes
- Items count from dashboard stats
Changed
PLAN_FEATURESupdated from generic (basic,export) to domain-specific (dashboard,coffee_only,all_commodities,full_history,export,api)PLAN_LIMITSchanged fromitems/api_callstocommodities/history_years/api_calls- API now requires Starter or Pro plan (free plan gets 403)
- Dashboard routes and API routes import analytics module (not individual functions) for testability
- Billing tests updated to match new feature and limit names