Helping to connect people to mental health services.
Clone the repo: git clone https://github.com/nhsuk/mental-health-service-finder.git
and review the scripts
to get up and running.
The application uses Docker to run in containers. Development is typically done on the host machine. Files are loaded into the container and changes are automatically updated.
Use the test
script for continuous testing during development.
As the application is being developed, every Pull Request has its own test environment automatically built and deployed to.
Every environment apart from the one we want the public to access requires basic authentication to access. The username and password are not secret, in fact they are included within environment variable table below. The intention with the authentication challenge is to prevent people whom may stumble across the site and not realise it is for testing, it also prevents access by search engines and other bots.
Environment variables are expected to be managed by the environment in which the application is being run. This is best practice as described by twelve-factor.
In order to protect the application from starting up without the required env vars in place require-environment-variables is used to check for the env vars that are required for the application to run successfully. This happens during the application start-up. If an env var is not found the application will fail to start and an appropriate message will be displayed.
Environment variables are used to set application level settings for each environment.
Variable | Description | Default | Required |
---|---|---|---|
ADOBE_TRACKING_URL |
Adobe Analytics Dynamic Tag Management URL | No | |
BASIC_AUTH |
An MD5 encrypted htpasswd | See value set in Vault for BASIC_AUTH in defaults |
|
COOKIEBOT_SCRIPT_URL |
The URL for the in-house implementation of Cookiebot | //assets.nhs.uk/scripts/cookie-consent.js | |
HOTJAR_ANALYTICS_TRACKING_ID |
Hotjar tracking id | No | |
LOG_LEVEL |
Numeric log level | Depends on NODE_ENV |
|
NODE_ENV |
Node environment | development | |
PORT |
Server port | 3000 | |
SEARCH_API_HOST |
Host name for the NHS Developer API | api.nhs.uk | Yes |
SEARCH_API_KEY |
subscription-key for the NHS Developer API |
Yes | |
SEARCH_API_VERSION |
Version of the NHS Developer API | 1 | Yes |
HEADER_FOOTER_API_ENDPOINT |
JSON endpoint for NHS.UK header and footer API | https://nhsuk-apim-dev-uks.azure-api.net/menu/?api-version=1 |
Yes |
HEADER_FOOTER_API_CACHE_TIMEOUT |
Time in seconds for the expiry of the header and footer data cache | 300 | Yes |
HEADER_FOOTER_API_KEY |
subscription-key needed for higher environments of the NHS.UK header and footer API |
No |
LOG_LEVEL
must be a number and one of the defined log levelsThis repo uses Architecture Decision Records to record architectural decisions for this project. They are stored in doc/adr.