A production-ready, full-stack OCPP 1.6 & 2.1/2.0.1 Charge Point Management System (CPMS) EV charging platform.
- Overview
- High-Level Architecture
- Project Structure
- Key Features
- Technology Stack
- Quick Start
- Detailed Setup
- Configuration
- Connecting a Charger
- Contributing
- About MobilityPulse
- License
The system consists of four primary layers that work together to manage EV chargers end-to-end:
┌─────────────────────────────────────────────────────────────────────────┐
│ OCPP CMS – High-Level Architecture │
└─────────────────────────────────────────────────────────────────────────┘
┌──────────────────┐ OCPP 1.6 & 2.1/2.0.1 WebSocket ┌──────────────────────────┐
│ EV Chargers / │ ◄─────────────────────────────────► │ OCPP WebSocket Server │
│ Charge Points │ ws://host:9220/OCPP/[1.6|2.1]/{id} │ (Node.js / ws library) │
└──────────────────┘ └────────────┬─────────────┘
│
│ Internal Events
▼
┌──────────────────┐ HTTPS / REST API ┌──────────────────────────┐
│ Next.js Admin │ ◄─────────────────────────────────► │ Express REST API │
│ Dashboard │ http://host:3000/api/v1/... │ (TypeScript / Prisma) │
│ (Frontend UI) │ └────────────┬─────────────┘
└──────────────────┘ │
│ ORM Queries
▼
┌──────────────────┐ WebSocket (Live Logs) ┌──────────────────────────┐
│ OCPP Log │ ◄─────────────────────────────────► │ PostgreSQL Database │
│ Viewer (UI) │ ws://host:3001 │ (via Prisma ORM) │
└──────────────────┘ └──────────────────────────┘
│
│ Pub/Sub & Caching
▼
┌──────────────────────────┐
│ Redis (ioredis) │
└──────────────────────────┘
flowchart TD
CP["⚡ EV Charge Points\n(Physical Chargers)"]
OCPP["OCPP WebSocket Server\nws://:9220/OCPP/[1.6|2.1]/{id}"]
API["Backend REST API\nExpress + TypeScript\nhttp://:3000"]
DB[("PostgreSQL Database\n(via Prisma ORM)")]
UI["🖥️ Admin Dashboard\nNext.js 15 + shadcn/ui\nhttp://:3002"]
LOGS["📋 Live OCPP Log Viewer\nWebSocket Stream\nws://:3001"]
CP <-->|"OCPP 1.6 & 2.1/2.0.1 JSON\nWebSocket"| OCPP
OCPP -->|"Internal events\n& data writes"| API
API <-->|"ORM queries\n& migrations"| DB
UI <-->|"HTTPS / REST"| API
UI <-->|"WebSocket stream"| LOGS
OCPP -->|"Real-time\nlog broadcast"| LOGS
OCPP <-->|"Pub/Sub\n& Caching"| REDIS[("Redis Cache")]
API <-->|"Pub/Sub\n& Caching"| REDIS
API -->|"Dynamic Power Limits"| LMS["Load Management Service"]
LMS -->|"SetChargingProfile"| OCPP
| Flow | Protocol | Description |
|---|---|---|
| Charger ↔ OCPP Server | OCPP 1.6 & 2.1/2.0.1 (WebSocket JSON) | Boot, Heartbeat, Authorize, Start/Stop Transaction, MeterValues |
| Dashboard ↔ API | HTTPS REST | Station management, analytics, RFID, tariffs, user auth |
| Dashboard ↔ Log Server | WebSocket | Real-time OCPP message streaming for monitoring/debugging |
| API ↔ Database | Prisma ORM (SQL) | All persistent data — chargers, sessions, tariffs, users |
open-source-csms/
├── Backend/ # Node.js + TypeScript OCPP & API server
│ ├── src/
│ │ ├── ocpp/ # OCPP 1.6 & 2.1/2.0.1 WebSocket handler & message processors
│ │ ├── api/ # REST API routes (auth, stations, chargers, rfid, etc.)
│ │ │ ├── auth/
│ │ │ ├── stations/
│ │ │ ├── chargers/
│ │ │ ├── connectors/
│ │ │ ├── transactions/
│ │ │ ├── rfid/
│ │ │ ├── tariffs/
│ │ │ └── dashboard/
│ │ ├── middleware/ # Auth & error handling middleware
│ │ ├── config/ # App configuration
│ │ └── utils/ # Shared utilities
│ ├── prisma/ # Prisma schema & migrations
│ └── package.json
│
├── Frontend/ # Next.js 15 admin dashboard
│ ├── app/ # App Router pages & layouts
│ ├── components/ # Reusable UI components (shadcn/ui based)
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # API client & utility functions
│ └── package.json
│
├── SETUP.md # Detailed setup guide
└── README.md # This file
- Full support for core OCPP 1.6 & 2.1/2.0.1 JSON messages:
BootNotification,Heartbeat,Authorize,StartTransaction,StopTransaction,MeterValues,StatusNotification,ChangeAvailability,Reset,UnlockConnector,TriggerMessage, and more.
- Live charger status monitoring (Available, Charging, Faulted, Offline)
- Active session tracking with live energy and duration counters
- Real-time OCPP message log viewer for debugging
- Start/stop charging sessions remotely
- Reset chargers (Soft/Hard)
- Unlock connectors
- Change charger availability
- Full whitelist management for RFID-authorized sessions
- Add, remove, and manage authorized tags from the dashboard
- Transaction history with filtering
- Energy usage statistics per station and charger
- Status distribution and availability metrics
- Manage multiple charging stations across different locations
- Each station supports multiple chargers with multiple connectors
- Define and manage tariffs per station
- Associate pricing with charging sessions
- Intelligent power distribution via
LoadManagementService. - Dynamically recalculates and dispatches
SetChargingProfilecommands based on active sessions andmaxPowercapacity at the Station and Charge Group level.
- Foundational database schema (
OcpiEndpoint,OicpEndpoint), routing (/api/ocpi,/api/oicp), and a dedicated/roamingadmin page configured for EV roaming and CDR exchange integrations.
- Placeholder models and routes added to enable future Stripe/Mollie integration for automated transaction billing.
- JWT-based authentication for the admin dashboard with role-based access control.
- Explicit Postgres 15+ schema privilege management via Prisma.
| Layer | Technology |
|---|---|
| Runtime | Node.js 20+ |
| Language | TypeScript |
| Framework | Express.js |
| OCPP Protocol | Native ws WebSocket library |
| Database | PostgreSQL 15+ |
| Caching/PubSub | Redis (ioredis) |
| ORM | Prisma |
| Auth | JWT (jsonwebtoken) |
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| UI Components | shadcn/ui |
| State Management | React Hooks & Context API |
| Icons | Lucide React |
git clone https://github.com/savekar-ev/open-source-csms.git
cd open-source-csmscd Backend
cp .env.example .env
# Edit .env — set your DATABASE_URL and other variables
npm install
npm run prisma:generate
npm run prisma:migrate
npm run devcd Frontend
npm install
npm run dev| Service | URL | Description |
|---|---|---|
| Admin Dashboard | http://localhost:3002 |
Frontend UI |
| REST API | http://localhost:3000 |
Backend API |
| OCPP WebSocket | ws://localhost:9220 |
Charger connections |
| OCPP Log Stream | ws://localhost:3001 |
Live log viewer |
For a step-by-step guide covering local environment configuration, as well as a complete manual for Production Deployment on Google Cloud (Ubuntu VM) — see SETUP.md.
- User Manual: A comprehensive guide on how to navigate the CMS dashboard, manage stations/chargers, RFID tags, and use remote operations.
- Proposed Improvements: An outline of architectural enhancements and advanced features (e.g., Docker, Redis, OCPI) recommended for production scaling.
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://user:pass@localhost:5432/ocpp_cms |
PORT |
REST API port | 3000 |
OCPP_PORT |
OCPP WebSocket port | 9220 |
OCPP_LOG_WS_PORT |
Live log WebSocket port | 3001 |
JWT_SECRET |
Secret for JWT signing | your-strong-secret-key |
Once the backend is running, connect any OCPP 1.6 & 2.1/2.0.1 compliant charger or simulator to:
ws://<your-host>:9220/OCPP/[1.6|2.1]/<charger-id>
Note:
<charger-id>must match thecharger_idof a charger registered in the system (via the dashboard or database seeding).
You can use any OCPP 1.6 & 2.1/2.0.1 simulator such as:
We welcome contributions from the community! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'feat: add your feature' - Push the branch:
git push origin feature/your-feature-name - Open a Pull Request with a clear description of what you changed and why
- Follow the existing code style (TypeScript, Prettier formatting)
- Add meaningful commit messages (we follow Conventional Commits)
- For large features, please open an Issue first to discuss the approach
- Ensure the backend compiles (
npm run build) and the database schema is consistent
Found a bug or have a feature request? Open an issue on GitHub with as much detail as possible.
MobilityPulse is India's first WhatsApp + UPI EV charging platform — enabling property owners, housing societies, and businesses to monetize EV charging with our affordable, app-less CMS solution. Users can initiate charging sessions directly via WhatsApp with no downloads required.
We open-source our core OCPP CMS so the broader EV ecosystem can benefit, innovate, and grow together.
| 🌐 Website | mobilitypulse.com |
| ⚡ Cloud CSMS | csms.savekar.com |
| 🔬 OCPI Simulator | GitHub |
| 📧 Contact | savekarev@gmail.com |
| 📞 Phone | +91 9588033707 |
| 📍 Location | Bangalore, Karnataka, India |
This project is licensed under the ISC License. See the LICENSE file for details.
Built with ❤️ by the MobilityPulse team | Powering India's EV Future