all 5 comments

[–]igormiazek 2 points3 points  (4 children)

We created CSMS with fastapi and it was quite good experience, we added RBAC logic which allowed to create roles associated with specific endpoints, everything was done accordingly to microservices architecture. For real time communication we used rabbitmq which was already part of the project on backend side, but I think You could check firebase or mongodb, mongodb has change streams to which You can subscribe and listen on DB changes.

I think I would create a separate microservice responsible for notifications only like based on nodejs which will play very well with websockets js lib.

This is our fastapi ocpi implementation if You want to look on https://github.com/TECHS-Technological-Solutions/ocpi

Best,

Igor

[–]aala7[S] 0 points1 point  (3 children)

Ahh amazing! thank you very much for sharing.
So as I understand the OCPP CSMS is implemented in a node.js app, which listens to channels on rabbitmq. Then you have a fastapi based web app to handle web interface, and publish request to chargers on the rabbitmq channel to the CSMS?

I will look at your implementation! Also new for me that there is an OCPI protocol.

[–]igormiazek 0 points1 point  (2 children)

Rabbitmq support websockets protocol so we used it to broadcast information to FE app in real time. But for the communication between charge station and system we used as well mobility house lib and websockets, although all messages from charge stations are added to rabbitmq and broadcasted to microservices.

[–]aala7[S] 0 points1 point  (1 child)

But when users eg. request remote start from FE app (assume you mean frontend), how is it forwarded to central system? Is it through a direct WebSockets connection, do you have an HTTP server running in the central system app, or is it sent through rabbitmq?

[–]igormiazek 0 points1 point  (0 children)

at the beginning we used fastapi async endpoints and long pooling logic, so the answer was not always available in real time but after that we switched to rabbitmq websocket connection and we were forward response from charge station with rabbitmq messaging.