A micro service that manages organisations' test results. We have abstracted other aspects such as authentication.
Above shows the entity relationship between an organisation (organisation), its users (profile) and their test results (sample)
- node v10
- npm
npm ci-- Install dependenciesnpm run watch-- Watchnpm run build-- Buildnpm run test-- Testnpm audit-- Auditnpm run dev-- Run locally as node process, note that a local postgres instance must be set up and its hostname must be updated atsrc/resource/api.json(docker-compose up -d --build postgresbrings up only the empty postgres container)
API format follows JSON:API (https://jsonapi.org/)
curl --location --request POST 'http://localhost:8080/test/v1.0/org/84298aa5-27a9-4d54-a357-d8cbe174bb39/profile' \
--header 'Content-Type: application/json' \
--data-raw '{
"data": {
"type": "profile",
"attributes": {
"name": "John Wayne"
}
}
}'
curl --location --request GET 'http://localhost:8080/test/v1.0/org/84298aa5-27a9-4d54-a357-d8cbe174bb39/profile/c072284e-eb1f-4294-b06c-26c010a3b4eb'
curl --location --request POST 'http://localhost:8080/test/v1.0/org/84298aa5-27a9-4d54-a357-d8cbe174bb39/profile/c072284e-eb1f-4294-b06c-26c010a3b4eb/sample' \
--header 'Content-Type: application/json' \
--data-raw '{
"data": {
"type": "result",
"attributes": {
"sampleId": "12345678",
"resultType": "rt-pcr"
}
}
}'
curl --location --request GET 'http://localhost:8080/test/v1.0/org/84298aa5-27a9-4d54-a357-d8cbe174bb39/profile/c072284e-eb1f-4294-b06c-26c010a3b4eb/sample/12345678'
- Docker (https://docs.docker.com/get-docker/)
- Docker Compose (https://docs.docker.com/compose/install/)
docker-compose up -d --build-- Build and set up swagger, postgres and servicedocker-compose down --rmi all-- Shutdown and clean up- Go to
http://localhost:9080/swagger/to interact with APIs