How motown-io/motown works
Project type and purpose
• motown is a modular, Java-based, event-driven platform for integrating EV charging infrastructure.
• It is organized as a collection of modules (services and libraries) that communicate via commands and events on a message bus (using Axon).
Key architectural layers & modules
• Domain Core
– domain/core-api: shared command and event definitions (POJOs).
– domain/command-handling, domain/command-authorization: command handlers and authorization logic.
– domain/utils: shared utilities for correlation, interceptors, event gateways.
• Application Services
– chargingstation-configuration, identification-authorization, incoming-datatransfer, selective-authorization, etc.
– Each has an “app” submodule (command side, Spring-Axon handlers) and a “view-model” submodule (event listeners, Spring REST/DB).
• Operator API
– operator-api/json: JSON-over-HTTP REST API (Jersey) exposing commands.
– operator-api/view-model: event listeners projecting into a HSQLDB view.
• Protocol adapters / external connectors
– ocpp/v12-soap, ocpp/v15-soap: SOAP endpoints for OCPP.
– ocpp/websocket-json: WebSocket JSON endpoint for OCPP v15.
– mobi-europe/source & destination: SOAP and REST adapters for e-mobility roaming.
– ocpi/ocpi-identification-authorization-plugin: plugin implementing OCPI auth.
– vas/v10-soap & vas/view-model: Value-Added Services SOAP publisher/subscriber.
• Samples & Configuration
– samples/*: “reference architecture” Spring boot deployments, simple and distributed.
– configuration plugins illustrate how to compose modules in a container.
How commands and events flow
• A REST/JSON or SOAP/WebSocket request arrives at a protocol adapter (operator-api, ocpp, mobi-europe, ocpi, vas).
• The adapter translates to a Domain Command and sends it to the CommandGateway (Axon).
• Domain/command-handling and domain/command-authorization consume the command, apply business logic, emit Domain Events.
• Events are published on the message bus.
• View-model modules (per service) listen for events, update their own persistence (HSQLDB), and expose read models (REST or JAX-RS).
Detail level
– Capture all major modules (operator-api, chargingstation-configuration, identification-authorization, mobi-europe, ocpp, ocpi, vas).
– Show shared libraries only once, annotate which modules depend on them.
– Do not clutter with every sub-package—focus on submodule level and communication channels.
– Annotate key Spring/Axon components: CommandGateway, EventHandlers, Repositories.