FlexMeasures is a Flask-based energy flexibility management platform that ingests time-series sensor data, forecasts future values, schedules flexible assets (batteries, heat pumps, industrial processes) using linear optimization, and reports on performance. It provides a REST API (v3.0), a web UI with interactive charts, a CLI for data management, and background job queues (RQ) for forecasting, scheduling, and automation. The architecture is a multi-tenant web application with PostgreSQL, Redis, and optional Sentry monitoring. It features a plugin system for custom data generators (forecasters, schedulers, reporters) and automation handlers. The codebase is well-tested with extensive unit and integration tests, and follows modern Python practices (type hints, Marshmallow schemas, Click CLI).