Skip to content

Local development

The api directory is a TypeScript/Express application using Yarn and Node.js. Its container mounts the local api directory into /usr/src/app; the image startup script installs dependencies and runs nodemon -L.

Terminal window
cd api
yarn install
yarn dev

Use yarn start to compile with tsc and run dist/app.js. The package currently has no build script and its test script is only a failing placeholder.

The patient endpoint requires a reachable FHIR_URL, HEALTHTAG_API_URL, and Harmony RPC in addition to the Express process. Use .healthtag-api.env for local Compose values and never commit tokens or keys.

Terminal window
curl --fail http://localhost:9000/api/health-check
curl --fail http://localhost:8080/fhir/metadata

For patient tests, use synthetic FHIR records and mock or isolated authorization dependencies. Required automated coverage includes missing fields, failed upstream validation, owner self-access, allowed third-party access, denied third-party access, no matching patient, and FHIR failure.

[!IMPORTANT] Fix the risks listed in Security hardening before treating patient endpoint results as valid authorization tests.