- Docker
- Nodejs, or manage multiple versions of Node using NVM
- A text editor of your choice.
- Clone/download the repository.
- This project was developed to address the requirements defined in a Didomi challenge located here
The entity-relationship diagram that represents the data model for this exercise is:
Overview of the technical components.
- Open a terminal window
- Change directory to the root of the Node.js project
cd ./consents/
. - Run the server
ENVIRONMENT=DEVELOPMENT npm run start
.
The API will be listening for requests at http://localhost:3000/api/v1
.
You can view Swagger documentation by visiting http://localhost:3000/api
in your browser.
- Open a terminal window
- Change directory to the root of the Node.js project
cd ./consents/
. - Run the unit tests
npm run test
ornpm run test:watch
to have continuous feedback.
- Open a terminal window.
- Run an instance of the Postgres database locally using the script found here
- Open another terminal window
- Change directory to the root of the Node.js project
cd ./consents/
. - Run the e2e tests
npm run test:e2e
ornpm run test:e2eWatch
to have continuous feedback.
├── CHALLENGE.md <------ The requirements specification this project is based on.
├── CHANGELOG.MD <------ Pull request notes may be added here.
├── README.md <------ Overall details about this project.
├── consents <------ The Node.js project files are in here.
│ ├── nest-cli.json
│ ├── package-lock.json
│ ├── package.json <------ Node.js project metadata and dependency management.
│ ├── src
│ │ ├── app.controller.spec.ts <------ App-level functionality
│ │ ├── app.controller.ts |
│ │ ├── app.module.ts |
│ │ ├── app.service.ts <--|
│ │ ├── events <------ Event entity functionality.
│ │ ├── main.ts
│ │ └── users <------ User entity functionality.
│ ├── test
│ │ ├── app.e2e-spec.ts <------ Testing the application from a User perspective.
│ │ └── jest-e2e.json
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── diagrams <------ Diagrams used to visualize the project.
│ ├── design.drawio <------ Drawings that to work through the specification.
│ ├── entity-relationship.png <------ The data model that was implemented.
│ ├── system-architecture.png <------ What the application consists of technically.
└── start-postgres-tmpfs.sh
Swagger documentation can be accessed after running npm run start
and visiting http://localhost:3000/api
in a browser.
Delete dangling resources docker system prune
or all containers/images/builds docker system prune -a
, WARNING this will delete any Docker resources on your machine.
- Add decoupled event emitter functionality to address the remaining failing test cases.
- Run a memory profiling tool as described here, to identify opportunities for optimization.
- Consider whether further decoupling would be beneficial, i.e. do we need to consider another Topic subscription service and task/queue outside of the container process.
- Refactor some of the code for increased readability, adding a data factory for generating entity record test data.
- Add Logging, Telemetry, and Metrics using the standard that the organization has decided on.
- Move the Data transformations into the respective
Dto
.