Skip to content

Latest commit

History

815 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

MiGrid Hero Image

MiGrid

The Operating System for Sustainable Fleet Electrification

VersionLicensePlatformNodeDocker

FeaturesArchitectureQuick StartDocumentationRoadmap


Overview

MiGrid is an open-source, enterprise-grade operating system designed to transform electric vehicle fleets from simple transportation assets into active, revenue-generating participants in the energy grid.

Our unified 11-layer platform spans from the physics of energy transfer to the tokenization of grid-supportive actions, enabling fleets to participate in wholesale energy markets, demand response programs, and Vehicle-to-Grid (V2G) operations.

MiGrid: The Operating System for Sustainable Fleets

VersionLicenseStatus

MiGrid is an open-source, vertically integrated operating system designed to bridge the gap between physical EV assets and digital energy markets. We enable fleets to turn parked vehicles into revenue-generating Virtual Power Plants (VPPs) through physics-verified, standards-compliant orchestration.


Core Philosophy

We do not trust the driver; we verify the physics.

  1. Verify the Physics: Every charging session is audited against a Physics Engine (L1) that compares energy dispensed vs. battery capacity with a strict <15% variance threshold.
  2. Unlock the Grid: We don't just consume energy; we manage it. Our stack is built for OpenADR 3.0 compliance, turning load shedding and price signals into automated fleet actions.
  3. Tokenize Value: Grid-supportive behaviors are measured, verified, and rewarded directly to the driver's wallet via our Token Bridge (L10).

Platform Engineering

MiGrid is built on a streamlined, high-precision architecture designed for the realities of critical infrastructure. Our engineering principles prioritize physics verification, low-latency data processing, and uncompromising security.

Core Architectural Pillars

  • Physics-First Verification (L1): We do not trust digital signals blindly. All energy transactions are validated against a proprietary Physics Engine that audits charging sessions using "Digital Twin" models to detect anomalies and enforce capacity limits.
  • Real-Time, Low-Latency Data: The platform utilizes Redis for sub-millisecond state caching and Apache Kafka for event streaming, enabling real-time responsiveness for frequency regulation (<500ms) and high-frequency market bidding.
  • Edge-to-Cloud Resilience: Our Edge Runtime ensures site-level orchestration and mesh networking continue seamlessly even without cloud connectivity ("The Fuse Rule"), supported by a Multi-Region Active-Active cloud deployment for global resilience.

Technology Stack & Standards

We leverage a modern, cloud-native stack to ensure scalability and adherence to global energy standards:

  • Infrastructure as Code: Fully containerized deployments via Docker and Kubernetes, managed with Terraform.
  • Data Layer:TimescaleDB for high-fidelity time-series energy metrics and PostgreSQL for relational core data.
  • Security & Compliance: Built on a Zero-Trust Architecture with mTLS everywhere. We strictly adhere to NERC CIP and IEC 62351 cybersecurity standards.
  • Interoperability: Native support for OpenADR 3.0 (VEN), OCPP 2.1 (Native V2G/V2X), OCPP 2.0.1 (Legacy Smart Charging), and ISO 15118 (Plug & Charge).

11-Layer Microservices Architecture

The system is decoupled into eleven distinct functional planes to separate concerns between physics, markets, data science, and user experience.

LayerServiceDescriptionStandards
L1physics-engineThe "Green Audit" — verifies kWh dispensed vs received.PL/pgSQL
L2grid-signalVirtual End Node (VEN) for utility communication.OpenADR 3.0
L3vpp-aggregatorAggregates EVs & BESS for wholesale markets.IEEE 2030.5
L4market-gatewayArbitrage engine for CAISO, PJM, and Nord Pool.FIX / OASIS
L5driver-dxSmart routing, voice commands, and availability.GraphQL
L6engagementAchievement-based driver behavior shaping.WebSocket
L7device-gatewayHardware abstraction for chargers.OCPP 2.1 / 2.0.1 / ISO 15118
L8energy-managerEdge-ready dynamic load management (DLM).Modbus TCP
L9commerce-engineFlexible billing, tariffs, and split-billing.Stripe / OCPI
L10token-bridgeRewards and staking via Open-Wallet.ERC-20 / Polygon

Core Philosophy

[I] Verify the Physics

"Verify the physics. Unlock the grid."

Every charging session is audited to ensure energy dispensed matches energy received (<15% variance threshold).

[II] Unlock the Grid

"The Grid is a partner, not just a plug."

Active site load management, utility signal response, and grid stability prioritization.

[III] Tokenize Everything

"Every electron must be a tokenized asset."

Grid-supportive actions are measured, valued, and rewarded through Web3 incentives.


Key Features

[▸] Full-Stack V2G/VPP Control

Built from the ground up to support FERC Order 2222, enabling fleets to:

  • Aggregate EVs into 100kW+ Virtual Power Plants (VPPs)
  • Bid into wholesale energy markets (CAISO, PJM, ERCOT)
  • Participate in demand response programs
  • Generate revenue from grid services
[▸] Fintech-Grade Ledger

Treats every kilowatt-hour and dollar as a high-precision asset:

  • PostgreSQL with TimescaleDB for time-series data
  • Decimal.js for zero rounding errors
  • Complete financial audit trail
  • Real-time settlement reconciliation
[▸] Tokenized Driver Incentives

Built-in Web3 rewards system via Open-Wallet Framework:

  • ERC-20 tokens on Polygon
  • Reward drivers for grid-friendly behavior
  • Smart charging bonuses
  • V2G participation rewards
  • Gamification and leaderboards
[▸] Hardware Agnostic

Universal hardware abstraction layer:

  • OCPP 2.1 (Flagship) & 2.0.1 support
  • OCPP 1.6 legacy support
  • OCPP 2.1 (Native V2X), 2.0.1 & 1.6 support
  • ISO 15118 Plug & Charge (in progress)
  • V2G bidirectional control
  • No vendor lock-in

Technical Architecture

The 10-Layer Stack

MiGrid is built as a microservices monorepo with event-driven architecture

graph TB
subgraph "Application Layer"
L5[L5: Driver Experience]
L6[L6: Engagement Engine]
end
subgraph "Intelligence Layer"
L11[L11: ML Engine]
L3[L3: VPP Aggregator]
end
subgraph "Market Layer"
L4[L4: Market Gateway]
L2[L2: Grid Signal]
end
subgraph "Infrastructure Layer"
L1[L1: Physics Engine]
L7[L7: Device Gateway]
L8[L8: Energy Manager]
end
subgraph "Business Layer"
L9[L9: Commerce Engine]
L10[L10: Token Engine]
end
Loading
[≡] View Full Service Matrix
LayerServiceDescriptionPortStatus
L1Physics EngineEnergy variance validation (<15% threshold)3001v10.1.6
L2Grid SignalOpenADR 3.0 VEN for demand response3002v2.5.6
L3VPP AggregatorFleet capacity aggregation for markets3003v3.3.2
L4Market GatewayCAISO/PJM/ERCOT wholesale integration3004v3.8.8
L5Driver Experience APIMobile backend, auth, smart routing3005v4.1.0
L6Engagement EngineGamification, leaderboards, achievements3006v5.17.0
L7Device GatewayOCPP 2.1, ISO 15118, V2X control3007v5.12.0
L8Energy ManagerDynamic Load Management (DLM)3008v2.1.0
L9Commerce EngineBilling, tariffs, split-billing3009v5.1.0
L10Token EngineWeb3 rewards via Open-Wallet3010v4.3.8
L11ML EngineAI forecasting, predictive maintenance3011v0.5.0

Technology Stack

Backend & Infrastructure

  • Node.js 18+ & Express.js
  • Python (ML services)
  • PostgreSQL 15+ with TimescaleDB
  • Apache Kafka event bus
  • Redis for caching
  • Docker + Kubernetes

Frontend & Mobile

  • React 19 + TypeScript
  • React Native with Expo
  • Fluent UI v9
  • Chart.js for visualization
  • JWT authentication
  • Web3 wallet integration

AI & Machine Learning

  • TensorFlow 2.x / PyTorch 2.x
  • MLflow for model management
  • LSTM/Transformer models
  • Predictive maintenance
  • Anomaly detection

Standards & Protocols

  • OCPP 2.1 (Flagship)
  • OCPP 2.0.1 & 1.6 (Legacy)
  • ISO 15118 Plug & Charge
  • OpenADR 3.0
  • OCPI 2.2 roaming
  • ERC-20 on Polygon

Use Cases

[1] Smart Fleet Charging

Scenario: Charge 50 vehicles by 6 AM at lowest cost

Solution:

  • Ingests TOU rates and LMP data
  • Creates optimized OCPP charging profiles
  • Concentrates charging during off-peak hours
  • Respects grid connection limits
  • Result: 30-40% cost savings

[2] Virtual Power Plant

Scenario: Grid operator needs demand response

Solution:

  • Receives OpenADR signals automatically
  • Aggregates V2G-capable vehicles
  • Dispatches bidirectional charging commands
  • Generates wholesale market revenue
  • Result: $50-200/MWh revenue opportunity

[3] Driver Rewards

Scenario: Incentivize off-peak charging behavior

Solution:

  • Mobile app prompts for optimal timing
  • Calculates grid support value
  • Mints tokens to driver wallet
  • Gamification with leaderboards
  • Result: 80%+ driver participation

[4] Home Charging Reimbursement

Scenario: Driver charges fleet vehicle at home

Solution:

  • Telematics verify energy received
  • Pulls precise TOU tariff by ZIP code
  • Calculates exact reimbursement
  • Automated payment processing
  • Result: Fair, accurate reimbursement

Quick Start

Prerequisites

# Required
[✓] Docker & Docker Compose
[✓] Node.js 18+
[✓] Git
# Optional (for development)
[*] PostgreSQL 15+ client
[*] Kubernetes (for production)

One-Command Deploy

# Clone and start
git clone https://github.com/dcplatforms/Migrid.git &&cd migrid
docker-compose up --build

Full Setup

[▸] Step-by-Step Installation

[1] Clone Repositories

# Main MiGrid platform
git clone https://github.com/dcplatforms/Migrid.git
# Open-Wallet service (for token rewards)
git clone https://github.com/ThomasC3/open-wallet.git
# Directory structure:# ./# ├── migrid/# └── open-wallet/

[2] Initialize Database

cd migrid
# Start infrastructure
docker-compose up -d postgres redis kafka zookeeper
# Run migrations
docker exec -i migrid-postgres-1 psql -U migrid -d migrid_core < scripts/migrations/001_init_schema.sql
# Seed demo data
npm install
node scripts/seed-data.js

[3] Start All Services

# Start entire platform
docker-compose up --build
# Or start specific services
docker-compose up physics-engine vpp-aggregator market-gateway

[4] Verify Deployment

# Health check all servicesforportin 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010;do
curl -s http://localhost:$port/health | jq
done

Access Points

ServiceURLDescription
Admin Portalhttp://localhost:5173Fleet management dashboard
Driver APIhttp://localhost:3005Mobile app backend
VPP Aggregatorhttp://localhost:3003Capacity management
Market Gatewayhttp://localhost:3004Trading operations
Energy Managerhttp://localhost:3008Load monitoring

Demo Credentials

Email: alice@demo.com
Password: demo123

Full deployment guide: See DEPLOYMENT.md for production setup

Platform Status

Version 10.1.6May 202684% Complete

PhaseFeaturesServices

Roadmap Progress

Phase 1: Foundation ████████████████████ 100% [✓] Q1 2025
Phase 2: Grid Integration ████████████████████ 100% [✓] Q2 2025
Phase 3: Market Access ████████████████████ 100% [✓] Q3 2025
Phase 4: Driver Experience ████████████████████ 100% [✓] Q4 2025
Phase 5: Enterprise Scale ████████████████████ 100% [✓] Q1 2026
Phase 6: AI & Optimization ████████████░░░░░░░░ 60% [ ] Q2 2026
Phase 7: Global Expansion ░░░░░░░░░░░░░░░░░░░░ 0% [ ] Q3 2026
Phase 8: Advanced Grid ░░░░░░░░░░░░░░░░░░░░ 0% [ ] Q4 2026
[≡] View Detailed Roadmap
PhaseQuarterFocusStatus
1Q1 2025Physics verification, Energy Manager MVPComplete
2Q2 2025OpenADR 3.0, Telematics bridgesComplete
3Q3 2025VPP aggregation, Wholesale marketsComplete
4Q4 2025Mobile app, Token ecosystemComplete
5Q1 2026Commerce engine, ISO 15118, Global marketsComplete
6Q2 2026ML forecasting, Predictive analyticsIn Progress
7Q3 2026Multi-tenant, International marketsPlanned
8Q4 2026Frequency regulation, ResiliencePlanned

Interactive Roadmap:View roadmap.htmlDetailed Status


Documentation

DocumentDescription
README.mdThis file - platform overview and quick start
DEPLOYMENT.mdComplete deployment guide with examples
PLATFORM_STATUS.mdDetailed progress tracking and metrics
docs/roadmap.mdFull roadmap with technical specifications
docs/roadmap.htmlInteractive visual roadmap
Service READMEsIndividual service documentation

Contributing

MiGrid is governed by a Technical Steering Committee (TSC). Major architectural changes require an RFC (Request for Comments).

  1. Read the Architecture Documentation
  2. Review the Roadmap
  3. Include physics constraint unit tests
  4. Follow safety invariants (e.g., "Never discharge BESS below 20%")
  5. Submit PR with detailed testing plan

License

Apache 2.0 License • Copyright © 2025-2026 MiGrid Contributors

See LICENSE for full details.


Links


MiGrid: Powering the Future of Sustainable Fleet Electrification

Built by the open-source community

GitHub starsGitHub forks

About

An Open-Source grid management platform for scaling electrified fleets, and converting stored power into dynamic revenue from your local smart grid

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages