Architecture
Overview of the architecture
The architecture is divided in multiple layers, the Databases are responsible for storing all the data that is collected by the dashboard. The Data-services are responsible for importing data and making aggregates of those data to make them quickly accessible by the API-layer. The dashboard self is a standalone PWA that is connected with the API-layer via an API-gateway.
Databases
PostgreSQL
PostgreSQL is used for persistent storage. The PostGIS and TimescaleDB extensions are used for extending the capabilities of PostgreSQL with geographical and timeseries related functionality.
Redis
Redis is an in-memory database for volatile non-geography related data.
Tile38
Tile38 is an in-memory database for volatile geography related data.
Data-services (importers and aggregators)
importer
Responsible for importing and processing all available vehicles every 30s into the dashboard. Github
zone-stats-aggregator
Counts the number of vehicles and rentals started and ended in every custom made zone every 5 minutes and stores it as timeseries data in PostgreSQL. Github
daily-report
Aggregates number of vehicles in public space and number of trips made per day so it’s quickly accessible for reporting and graphs. Github
microhubs-controller
Counts every 30s the number of vehicles in every microhub and decides if a microhubs should closed when reaching the maximum capacity. Github
od-matrix aggregator
Aggregates trips to OD (origins / destination) matrices every hour. Github
API-layer
dashboard-api
Main api, used for showing the main data of shared mobility in the dashboard. Github
admin-api
admin-api is responsible for administrative tasks like creating new users, and new organisations. Github
od-api
The od-api is used for the origin destinations matrix functionality within the dashboard. Github
policy-api
The policy-api is used for registering microhubs, analytical and no-parking zones. This api also provide the MDS functionality from the governement in the direction of operators. So that operators can process those data automatically. Github
API-gateway
FusionAuth
Responsible for the authentication of users, authorization (what privileges do every user have, and what data can a user is accessed) is handled by every individual API. FusionAuth
Kong
Kong is an API-gateway that authenticates all the traffic and proxies it to the right API. Kong