Skip to content

MongoDB for historical data

Feature ID FEA019
Subsystem the feature is part of Database
Responsible person Developers
Status Under review

Description

Storing historical data from Traffic Visualizer into a MongoDB database

Use Case 1 Developer wishes to store historical data into a database
Use Case 2 The user wishes to see what traffic has been like in the past
FUNC-REQ-C0019 The developer makes the software store historical data in a MongoDB database

Preliminary user stories

  • #24 As a city planner, I want to know which roads are congested so that we can see where we need to change road plans.
  • #41 As a delivery service company, I want to download a monthly report for my company of most common routes and average time spent in transit.
  • #54 As a customer, I want the service to use NoSQL database so that its compatible with our standards
  • #56 As a user, I want history data on the map so that I can plan stuff
  • #57 As a heavy traffic planner, I want to use Traffic Visualizer so that I can plan my heavy haulings to be moved at the best time of day.

User interface mock-up

MongoDB

Implementation

Historical data

Dependencies

- `axios` (v1.4.0): A library for making HTTP requests to the Digitraffic.fi API.
- `compression` (v1.7.4): Middleware for compressing HTTP responses.
- `cors` (v2.8.5): Middleware for enabling Cross-Origin Resource Sharing (CORS).
- `express` (v4.18.2): The web framework used for handling HTTP requests and building RESTful APIs.
- `http-status-codes` (v2.2.0): A library providing HTTP status code constants.
- `mongodb` (v5.6.0): A MongoDB driver for interacting with the MongoDB database.
- `node-localstorage` (v2.2.1): A library for using the localStorage API in Node.js.
- `redis` (v4.6.7): A Redis client library for Node.js.
- `redis-om` (v0.4.0-beta.3): A Redis Object Mapper for Node.js.
- `swagger-jsdoc` (v6.2.8): A library for generating Swagger documentation from JSDoc comments.
- `swagger-ui-express` (v4.6.3): Middleware for serving Swagger UI documentation.
- `tsconfig-paths` (v4.2.0): A utility for resolving TypeScript module paths.

Testing / possible acceptance criteria

Testcase Test source Responsible
Testcase 1 FUNC-REQ-C0019 Testers
Usability Requirement USAB-REQ-0006 Testers