Skip to content

srcfl/ems-dashboard

Repository files navigation

Sourceful EMS Dashboard

'Twas the night before Christmas, when all through the grid,
Not a circuit was stirring, each battery lid hid.
The solar panels gleamed in the moonlight with care,
In hopes that St. Nicholas soon would be there.

The meters were monitoring load with precision,
While data flowed smoothly with perfect transmission.
When out on the network there arose such a sight,
A dashboard so brilliant, it lit up the night!

With real-time data from Solana's blockchain,
And Privy authentication, so easy to main-tain.
The EMS optimizer works through the day,
Ensuring your energy never goes to waste, hooray!

So here is our gift, wrapped in Docker with care,
A blueprint for builders who wish to share.
May your batteries be charged and your solar shine bright,
Merry Christmas to all, and to all a good night! 🎄⚡

An open-source, real-time energy management dashboard for monitoring distributed energy resources (DERs) connected to the Sourceful Energy platform.

Christmas 2025 Gift - This project is open source and serves as a blueprint for developers building on the Sourceful Energy platform. We welcome contributions from developers, energy professionals, and anyone interested in advancing distributed energy resource management.

Features

  • Wallet Authentication - Secure login via Solana wallet using Privy
  • Real-time Monitoring - Live data for PV inverters, batteries, grid meters, and site load
  • Interactive Charts - Time series visualization with clickable legend to show/hide data series
  • Multi-DER Support - View all distributed energy resources at a site including energy meters
  • Adaptive Resolution - Charts automatically adjust data resolution based on time range
  • EMS Visualizations - Comprehensive Energy Management System (EMS) visualizations including:
    • EMS Status Dashboard - Real-time optimizer status, current mode, managed DERs, and electricity pricing
    • EMS Schedule Chart - Visual schedule showing optimization modes (IDLE, SELF_CONSUMPTION, FORCE_CHARGE, FORCE_DISCHARGE) over time with battery/EV state-of-charge, power forecasts, and pricing data

Quick Start

Prerequisites

  • Node.js 18+
  • A Solana wallet (Phantom, Solflare, etc.)

Installation

# Clone the repository
git clone https://github.com/srcfl/ems-dashboard.git
cd ems-dashboard

# Install frontend dependencies
cd frontend
npm install

Note: The Privy app IDs for Sourceful Energy are configured by default, so the project works out of the box. No environment configuration needed!

Important: This dashboard is currently configured to work only on localhost:3000 due to Privy's domain restrictions. This is intentional - we provide this as a blueprint and reference implementation for developers. We're working on a better solution for bringing your own wallet authentication, but for now, this serves as a complete example of how to integrate with the Sourceful API.

Running

Option 1: Docker (Recommended)

The easiest way to run the dashboard:

# Build and start
docker-compose up

# Or run in background
docker-compose up -d

# Stop
docker-compose down

Open http://localhost:3000 in your browser.

Option 2: Node.js Development Server

cd frontend
npm run dev

Open http://localhost:3000 in your browser.

Architecture

ems-dashboard/
├── frontend/          # React + TypeScript + Vite
│   ├── src/
│   │   ├── api/       # Sourceful API client
│   │   ├── auth/      # Privy authentication
│   │   ├── components/# UI components
│   │   ├── contexts/  # React contexts
│   │   └── hooks/     # Custom hooks
│   └── ...
└── docs/              # Documentation

API Integration

The dashboard connects directly to the Sourceful GraphQL API (api-vnext.srcful.dev) using Ed25519 wallet signatures for authentication.

For detailed API documentation, see:

DER Types Supported

Type Prefix Description
PV pv- Solar inverters
Battery bt- Battery storage systems
Meter em- Energy meters (grid connection)
Charger ch- EV chargers

Development

# Run development server
npm run dev

# Type check
npm run build

# Lint
npm run lint

Contributing

We welcome contributions from the Sourceful Energy community! Whether you're fixing bugs, adding features, improving documentation, or suggesting enhancements, your help makes this project better for everyone.

How to Contribute

  1. Fork the repository and create a new branch for your changes
  2. Make your changes - Follow the existing code style and add tests if applicable
  3. Test your changes - Ensure everything works and passes linting
  4. Submit a pull request - Include a clear description of your changes and why they're valuable

Areas We'd Love Help With

  • 🐛 Bug fixes and improvements
  • ✨ New features and DER type support
  • 📊 Enhanced visualizations and charts
  • 📝 Documentation improvements
  • 🎨 UI/UX enhancements
  • ⚡ Performance optimizations
  • 🧪 Test coverage

Questions or Ideas?

Feel free to open an issue to discuss ideas, report bugs, or ask questions. We're here to help!

Security

See SECURITY_AUDIT.md for security review details.

Key security features:

  • No hardcoded secrets
  • Environment-based configuration
  • Ed25519 wallet signatures for API auth
  • Console logs stripped in production builds

License

This project is open source and available under the MIT License.

Acknowledgments

Built with ❤️ for the Sourceful Energy community. Special thanks to all contributors who help make this project better.

Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages