Add BeanFlows MVP: coffee analytics dashboard, API, and web app
- 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>
This commit is contained in:
32
CHANGELOG.md
Normal file
32
CHANGELOG.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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 via `asyncio.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_year` to GROUP BY in `cleaned.psdalldata__commodity_pivoted` and carried through to `serving.commodity_metrics`. Previously summed across all market years, making per-year metrics meaningless.
|
||||
|
||||
### Removed
|
||||
- `items` table, FTS virtual table, and triggers from schema (boilerplate domain entity)
|
||||
- Items CRUD from API routes
|
||||
- Items count from dashboard stats
|
||||
|
||||
### Changed
|
||||
- `PLAN_FEATURES` updated from generic (`basic`, `export`) to domain-specific (`dashboard`, `coffee_only`, `all_commodities`, `full_history`, `export`, `api`)
|
||||
- `PLAN_LIMITS` changed from `items`/`api_calls` to `commodities`/`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
|
||||
Reference in New Issue
Block a user