How sap-labs-france/ev-server works
Project Type & Purpose
• This is a full-stack system:
• A NodeJS “Central Service” server (CSS) implementing OCPP (SOAP & JSON/WS) for Charging Stations.
• A NodeJS REST server (CSRS) exposing APIs to an Angular Dashboard front-end (separate repo).
• A MongoDB database.
• Background schedulers & asynchronous workers for tasks (OCPI pulls/pushes, billing, migrations, notifications).
• Integrations with external services: Stripe, SAP-Concur, OCPI, OICP, Car connectors, Smart Charging, Analytics.
Lay Out the Top-Level Containers
A. Charging Stations (external actors)
B. CSS – Central Service Server (NodeJS)
– Modules:
• OCPPServer (SOAP & JSON WebSocket)
• OCPPService, OCPPUtils, Validators (src/server/ocpp)
• OCPI Server (src/server/ocpi)
• OICP Server (src/server/oicp)
• OData Server (src/server/odata)
C. CSRS – REST API Server (NodeJS + Express)
– Modules:
• REST routers & services under src/server/rest/v1
• Authentication & ABAC (src/authorization)
• Validation (src/validator & storage/validator)
D. MongoDB (dockerized, replica set)
E. Scheduler & Async Task Worker (NodeJS processes)
– src/scheduler and src/async-task
F. External Services (3rd-party systems):
• Angular Dashboard (client)
• Stripe Billing
• SAP Concur refund
• OCPI/CPO / OICP networks
• Car Connector APIs
• SAP Analytics
• Email SMTP
G. Monitoring (Prometheus)
Architectural Patterns
• Layered architecture:
• Presentation Layer: REST API, OCPP endpoints
• Business Layer: Services (src/server/*/service), Authorization (ABAC)
• Integration Layer: src/integration/*, src/client/* for external protocols
• Persistence Layer: src/storage/mongodb + Validators
• Infrastructure/Support: Scheduler, AsyncTask, Migration, Monitoring, Caching, Locking
• Modularization by domain (asset, car, billing, pricing, smart-charging, notification)
• Use of ABAC for authorization (src/authorization)
• Asynchronous task execution and scheduling (src/async-task, src/scheduler)
Technologies & Frameworks
• Inside each container/component, list key frameworks and libraries:
• NodeJS + TypeScript
• Express, WebSocket, SOAP (wsdl)
• MongoDB (docker-compose, initdb scripts)
• Jest (unit tests, test/ folder)
• Dockerfiles, Docker Compose, AWS deployment scripts (src/aws)
• Prometheus monitoring (src/monitoring/prometheus)
• ABAC engine (src/authorization)
• OData (src/server/odata)
Drill-down Components
• OCPPServer, OCPI Server, OICP Server, OData Server as separate modules.
• How each module uses common utilities, validation, storage repositories, and the central AuthorizationManager.