Comparison & Approaches
Technical breakdown of how ocpp-ws-io approaches EV charging architecture, clustering, typing, and protocol validation alongside other Node.js solutions and platforms.
Architectural Comparison & Technical Approaches
Building a scalable OCPP Central System (CSMS) or Station Client involves navigating multiple architectural decisions: type safety, schema validation, horizontal clustering, smart charging algorithms, framework integration (NestJS, Express), and protocol translation.
The ocpp-ws-io ecosystem was engineered from the ground up to solve these challenges natively in TypeScript. Below is a technical breakdown examining different architectural approaches across Node.js tools, legacy packages, and turnkey CSMS platforms like CitrineOS.
1. Feature Matrix Overview
| Feature / Capability | ocpp-ws-io | @voltbras/ts-ocpp | ocpp-rpc | ocpp-eliftech | CitrineOS (LF Energy) |
|---|---|---|---|---|---|
| Last npm release | 3.1.0-beta.3, October 2026 | 2.7.3, March 2022 | 2.2.1, July 2025 | 1.0.2, April 2019 | — |
| OCPP 1.6-J Support | ✅ Full + Ajv Schema | ✅ Supported (and OCPP 1.5 over SOAP) | ✅ Supported + schemas in strict mode | ✅ Supported | ✅ Supported |
| OCPP 2.0.1 Support | ✅ Full + OCA Schemas | ❌ No | ✅ Supported + schemas in strict mode | ❌ No | ✅ Full |
| OCPP 2.1 Support | ✅ Full + OCA Schemas | ❌ No | ✅ Supported + schemas in strict mode | ❌ No | ⚠️ In Progress |
| NestJS First-Class Module | ✅ Native @OcppGateway | ❌ Manual boilerplate | ❌ No | ❌ No | ❌ No (Fastify stack) |
| TypeScript Type Safety | ✅ Zero any, OCA schemas | ✅ Good OOP types | ⚠️ .d.ts shipped, payloads typed any / unknown | ❌ No type declarations | ✅ TypeScript |
| Redis Multi-Pod Clustering | ✅ Built-in RedisAdapter | ❌ Memory-only | ❌ No | ❌ No | ⚠️ RabbitMQ based |
| Smart Charging Engine | ✅ ocpp-ws-io/smart-charge | ❌ No | ❌ No | ❌ No | ⚠️ Module based |
| Live Protocol Translation | ✅ ocpp-ws-io/proxy | ❌ No | ❌ No | ❌ No | ❌ No |
| Architecture Footprint | ⚡ Embeddable & Lightweight | ⚡ Lightweight | ⚡ Lightweight | ⚡ Lightweight | 🏢 Platform Stack (RabbitMQ, Hasura, Postgres) |
2. Comparing Architectural Models: CitrineOS (LF Energy / S44)
CitrineOS is an open-source Charging Station Management System hosted under LF Energy (Linux Foundation Energy).
CitrineOS Design
- Platform Stack: Built as a comprehensive, standalone CSMS platform.
- Infrastructure: Operates with PostgreSQL (with PostGIS), RabbitMQ message broker, and Hasura GraphQL services.
- Focus: Turnkey network operations, NEVI compliance goals, and pre-configured device schemas.
ocpp-ws-io Design
- Embeddable Toolkit: Built as an unopinionated, modular library suite. You install
npm install ocpp-ws-iointo your existing application or microservice architecture. - Framework Integration: Native
@OcppGatewaydecorators for NestJS, Express, Fastify, and Hono, allowing WebSocket upgrade routes to live directly alongside your existing REST APIs on the same port. - Database Freedom: Zero mandated database schema or external message brokers; works with Prisma, Drizzle, TypeORM, MongoDB, or pure in-memory stores.
- Protocol Translation Layer:
ocpp-ws-io/proxybridges legacy OCPP 1.6 stations to OCPP 2.1 systems dynamically on the wire.
3. Comparing with ocpp-rpc
ocpp-rpc is the most downloaded OCPP-J library on npm. It is an RPC layer: a server and a client, an auth callback, handlers, and strict-mode validation.
Key Strengths
- A small, well-documented API.
- Strict mode validates against the schemas of OCPP 1.6, 2.0.1 and 2.1.
- Security profiles 1 to 3. Basic Auth passwords are kept as raw bytes, and TLS comes from your own
httpsserver.
ocpp-ws-io Approach
- The same model, typed per action: ocpp-ws-io keeps ocpp-rpc's server, handlers, auth callback and strict mode. It also types each action's request and answer from
protocols. ocpp-rpc types payloads asany/unknown. - More than the RPC layer: Redis clustering, routing by URL, framework adapters, the protocol proxy and the smart charge engine.
- Moving over: Migrating from ocpp-rpc maps the API, and lists the defaults and error replies that differ.
4. Comparing with @voltbras/ts-ocpp
@voltbras/ts-ocpp is a respected TypeScript-first library that popularized typed OCPP in Node.js.
Key Strengths
- Clean class-based object-oriented API.
- Strong typing for OCPP 1.6-J messages.
- OCPP 1.5 over SOAP, which
ocpp-ws-iodoes not support. - Established community adoption.
ocpp-ws-io Approach
- Moving over: Migrating from @voltbras/ts-ocpp maps the API, and lists what changes for validation, errors and connections.
- Horizontal Scaling & Clustering:
ts-ocppmanages connections in-memory on a single process. Scaling across Kubernetes pods requires developers to build custom pub/sub routing.ocpp-ws-ioincludes an out-of-the-boxRedisAdapterwith O(1) station routing and presence heartbeats. - Multi-Protocol Negotiation:
ocpp-ws-ioprovides complete support for OCPP 2.0.1 and OCPP 2.1 alongside 1.6, allowing single servers to negotiate multiple protocols simultaneously. - Built-in Rate Limiting: Built-in token-bucket rate limiters drop rogue station floods (such as high-frequency
MeterValues) before JSON deserialization.
5. Comparing with ocpp-eliftech
ocpp-eliftech is one of the earliest production Node.js OCPP implementations.
Key Strengths
- Proven track record in early OCPP 1.6-J commercial deployments.
- Simple, unopinionated core.
ocpp-ws-io Approach
- Modern Protocol Architecture:
eliftechis constrained to OCPP 1.6.ocpp-ws-iohandles 1.6, 2.0.1, and 2.1 with shared connection interfaces. - Framework Adapters: Dedicated adapters for NestJS, Express, Fastify, and Hono.
- Observability: Seamless integration with
voltlog-iofor structured protocol telemetry.
Summary: Architecture Selection Guide
| Architectural Goal | Recommended Approach |
|---|---|
| Build an embeddable, type-safe OCPP 1.6/2.0.1/2.1 backend in NestJS or Express | ocpp-ws-io |
| Dynamic grid load balancing & smart charging math across chargers | ocpp-ws-io/smart-charge |
| Translate legacy 1.6 chargers to a 2.1 central backend on the wire | ocpp-ws-io/proxy |
| Deploy a standalone platform CSMS with RabbitMQ and PostgreSQL | CitrineOS |
| Interactive terminal simulator for QA and stress-testing | ocpp CLI (ocpp-ws-io) |
Move an existing ocpp-rpc, @voltbras/ts-ocpp or ocpp-ts project | Migration guides |