A publication-ready, distributed stream-processing implementation engineered for decentralized renewable energy grids. This system replaces legacy periodic batch reports with an edge-native Apache Kafka (KRaft Mode) pipeline to execute sub-millisecond local battery discharges and macro-grid power redirection.
- Producer Layer (
producer.py): Simulates high-frequency metric packet arrays emitting from regional solar inverters every 500ms using key-hashing partition routing. - Event Broker Core (
docker-compose.yaml): An ultra-fast single-node Kafka infrastructure running native KRaft consensus. - Control Actuator Loop (
consumer.py): Automatically computes localized load metrics and triggers reserve power injections. - Operator Portal (
dashboard.py): A production-grade web dashboard utilizing native math arrays for real-time SVG probability distributions and an integrated AI chat copilot layout.
Ensure Docker Desktop is active in the background. Right-click your docker-compose.yaml file inside VS Code and choose Compose Up (or execute via your system terminal):
docker compose up -d- verify your visual streaming database logs panel is online by navigating to:
http://localhost:9000(Kafdrop GUI).
source venv/bin/activate
pip install kafka-python-ng requestsOpen two separate parallel terminal panels inside your environment workspace:
- Terminal Tab 1 (Data Feed Ingestion): Run
python producer.py - Terminal Tab 2 (Operator Portal Engine): Run
python dashboard.py
Open your local internet web browser and visit: http://localhost:8000