AWS Builder Center
Building EnerFabric: Intent-Driven Energy Orchestration on AWS

Building EnerFabric: Intent-Driven Energy Orchestration on AWS

A technical walkthrough of EnerFabric: coordinating distributed energy resources with live telemetry, intents, policies, and an Amazon EC2 deployment.

Modern distributed energy systems are becoming increasingly heterogeneous. A single energy environment can include rooftop solar, battery storage, electric vehicles, flexible loads, critical loads, and the conventional grid — all producing different telemetry and operating under different constraints.
The challenge is not simply observing these assets. The harder problem is turning operational intent into coordinated decisions across them.
This is the problem I explored with EnerFabric, an intent-driven energy orchestration platform for Distributed Energy Resources (DERs).
The project brings together live telemetry, user intents, operating policies, and a deterministic coordination engine to produce feasible energy allocation plans while keeping the system observable through a real-time dashboard.
For the First Commit hackathon, I focused on taking the application from its existing Docker-based environment and shipping a publicly accessible deployment on Amazon EC2.



What is EnerFabric?

EnerFabric provides a unified control and observability layer for heterogeneous distributed energy resources.
The platform currently models:
  • Rooftop solar
  • Battery storage
  • EV charging
  • Flexible loads
  • Critical loads
  • Grid connection
Instead of treating every asset independently, EnerFabric allows an operator to express what needs to happen through an intent.
For example:
Charge the EV to 80% before the morning deadline.
That intent can then be evaluated alongside the current system telemetry and operating policies by the coordination engine.
The goal is to move from manually reasoning about individual assets toward a system where intent, constraints, and available resources can be evaluated together.



The core idea:

Intent → Policy → Coordination

The central workflow in EnerFabric is built around three concepts.

1. Intent

An intent represents an operational objective.
For the live demonstration, the EV asset has an intent equivalent to:
Asset: ev-1
Objective: Charge EV to 80% SOC
Deadline: 2026-09-21 07:00 UTC
Priority: 1
The intent describes the desired outcome without requiring the operator to manually specify every low-level energy allocation decision.

2. Policy

Policies describe how the system should behave while satisfying its operational objectives.
For the demonstration, a renewable-energy preference policy is used alongside the EV charging intent.
This separates the desired outcome from the rules that influence how the coordination engine reaches that outcome.

3. Coordination

The coordination engine evaluates the available system state, intents, and policies and produces a feasible allocation plan together with an explanation.
The important design decision here is that the coordination engine is deterministic and side-effect-free.
It receives system information as input and returns a coordination result rather than directly performing infrastructure changes.
This makes the decision-making layer easier to reason about, test, and evolve independently from the systems that collect telemetry or present the result.



Architecture

EnerFabric is composed of several focused services rather than one monolithic application.
architecture-diagram

The main components are:

Next.js dashboard

The frontend provides the operator-facing interface for:
  • System overview
  • Asset visibility
  • Live telemetry
  • Intents
  • Policies
  • Coordination
  • Impact information

FastAPI backend

The backend exposes the application API and coordinates communication between the frontend, persistence layer, MQTT telemetry pipeline, and orchestration logic.

PostgreSQL

PostgreSQL provides persistent storage for application state such as assets, intents, policies, and other backend data.

Eclipse Mosquitto

Mosquitto acts as the MQTT broker for telemetry communication.
This provides a lightweight event-driven path between the simulated DERs and the backend.

DER Simulator

Physical energy hardware is not required for the demonstration.
Instead, EnerFabric includes a deterministic simulator that models several DERs and continuously publishes telemetry through MQTT.
This makes it possible to demonstrate the complete data flow with reproducible system behavior.

Coordination Engine

The coordination engine is the decision-making layer.
It combines the current telemetry state with intents and policies and produces an allocation plan and explanation.
Keeping this component deterministic and side-effect-free means the decision logic can be evaluated separately from the infrastructure that transports and stores data.



Live telemetry through MQTT

A major part of the system is the telemetry pipeline.
The simulator continuously publishes readings for the modeled assets through MQTT.
The flow is:
DER Simulator
│
│ MQTT
▼
Mosquitto
│
▼
FastAPI
│
├── PostgreSQL
│
└── WebSocket
│
▼
Next.js Dashboard
During the deployment, six modeled assets are registered:
solar-1
battery-1
ev-1
flex-1
crit-1
grid-1
The dashboard can therefore show the system as a live environment rather than a collection of static demo values.
This was particularly useful during deployment because it gave me an immediate way to verify that the complete application pipeline was working: simulator → MQTT → backend → database/API → WebSocket → browser.



From an EV request to an orchestration decision

One of the simplest ways to understand EnerFabric is to follow a single operational request.
The demonstration starts with the EV:
Charge EV to 80% before the morning deadline.
The intent is stored by the backend and becomes part of the system's current operational state.
A policy is then applied to prefer renewable energy when coordinating the system.
The coordination layer can now consider:
  • Current asset telemetry
  • The EV's requested target
  • The deadline
  • Intent priority
  • Active operating policies
  • Available distributed resources
The output is a feasible coordination plan rather than a hard-coded response.
This separation is important because the same coordination architecture can be extended to other operational objectives without changing the telemetry transport layer or dashboard.



Shipping EnerFabric on AWS

For the hackathon deployment, I used Amazon EC2.
Rather than redesigning the application around multiple managed AWS services, I chose EC2 because the application already had a Docker Compose deployment model.
The deployment runs on an Ubuntu EC2 instance and contains:
Amazon EC2
│
├── Nginx
├── Next.js
├── FastAPI
├── PostgreSQL
├── Mosquitto
└── DER Simulator
Docker Compose manages the application containers.
Nginx acts as the single public entry point. The application services communicate through the Docker network, while only the required public entry point is exposed through the EC2 security configuration.
The resulting request path is:
Browser
│
▼
Public EC2 IP
│
▼
Nginx :80
│
├── Next.js
│
└── FastAPI
│
├── PostgreSQL
└── Mosquitto
▲
│
DER Simulator
This allowed the complete application to be shipped without replacing its existing service architecture.



The deployment debugging that mattered

Getting the containers to start was only part of the deployment.
One useful lesson came from a seemingly small routing issue.
The frontend health check requested:
/health
The initial nginx configuration routed the application API under  /api/ , but  /health  was reaching the frontend instead of FastAPI.
As a result, the dashboard reported that the backend was unavailable even though the backend container itself was healthy.
The fix was to explicitly route  /health  through nginx to the FastAPI service:
location = /health {
proxy_pass http://backend:8000/health;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
After recreating the nginx container with the updated configuration, the public health check reached the backend correctly and the dashboard showed the backend as online.
This was a good reminder that a container being "Up" does not necessarily mean the complete application is reachable through the production request path.



What I learned from shipping it

The biggest learning from this deployment was that moving an application from a local environment to a public server exposes problems that are easy to miss during local development.
A few examples:

1. Container health is not the same as application health

Docker can report every container as running while the browser-facing routing is still incorrect.
End-to-end checks are therefore important.

2. Reverse proxies are part of the application

Nginx was not just an infrastructure detail. Its routing rules directly determined which parts of the application the browser could reach.

3. Network boundaries matter

A simple deployment can still have meaningful boundaries.
In this setup, nginx is the public entry point, while internal services such as PostgreSQL and MQTT do not need to be directly exposed to the Internet.

4. Live telemetry makes debugging easier

The simulator continuously generating telemetry provided a practical end-to-end signal.
When the dashboard showed changing asset values, it confirmed that multiple layers of the system were communicating correctly.

5. Existing architecture can often be shipped before it is redesigned

Using EC2 allowed the existing Docker Compose architecture to be deployed without first converting the entire application to a different cloud-native architecture.
That made the deployment much faster while keeping the system understandable.



What's next for EnerFabric?

The current platform is an MVP, and there are several areas I would continue developing:
  • Persistent coordination-run history
  • Authentication and authorization
  • A more complete impact and emissions engine
  • More sophisticated optimization across DERs
  • Stronger production observability
  • More realistic physical DER models
  • Additional coordination policies and constraints
  • A production-grade multi-process WebSocket architecture
The longer-term goal is to make the coordination layer capable of handling increasingly complex combinations of energy assets, operational objectives, and system constraints.



Try EnerFabric

The project is open-source and the deployed application is available publicly.
Live deployment:  http://13.49.41.89/ 



Closing

EnerFabric started from a simple question:
What if an energy operator could describe what they want the system to achieve instead of manually deciding how every distributed resource should respond?
The project explores that idea through a combination of live telemetry, operational intents, policies, deterministic coordination, and a real-time dashboard.
For First Commit, the focus was not only on building the application, but on taking that system and actually shipping it on AWS.
The result is a publicly accessible energy orchestration platform running on Amazon EC2, with simulated DER telemetry flowing through MQTT into a live coordination and visualization pipeline.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article