NodeJS API logic and associated database logic for fetching time datapoints and aggregating them.
Broken down so that individual modules can be pulled out and plugged somewhere else. So this isn't the API routing code but the middleware.
We use PostgreSQL and Express.js.