Node.js 18.13
npm 8.19.3
git
git clone git@github.com:nhsconnect/prm-gp2gp-dashboard.git
cd prm-gp2gp-dashboard
npm ci
npm run enableGitHooks
GP2GP metrics JSON files are then required to build the dashboard. There are two options - to either retrieve them from the Data Pipeline Github repo, or to download them from S3. Below are instructions for both:
- Run
./tasks get-stubs
- Look inside
src/data/organisations
and there should be the following JSON files - nationalMetrics.json and practiceMetrics.json - Run
npm run develop
- This will run a local mock server that will mock API calls made dynamically on page load.
- It will then build, with hot-reloading enabled and with test SICBL and GP practices.
- E2E tests are configured to test against this stubbed data.
To retrieve these files from S3 you will need to be authenticated with AWS. It will overwrite the JSON files that you already have.
./tasks get-metrics <environment>
- Only available environments are dev or prod.
npm run develop:ci
Note: due to the nature of the E2E tests relying on having stubbed data, the E2E tests will fail if you have S3 data rather than stubbed data.
Note: Hot-reloading is not enabled, therefore after any changes are made you will need to repeat the above steps.
npm run build
npm run serve
npm run build:ci
npm run serve:ci
Note: due to the nature of the E2E tests relying on having stubbed data, you will need to ensure you have the stubbed data rather than S3 data when running E2E tests.
npm ci
npm run develop
npm run e2e:open
(in a separate terminal)- This will open the Cypress test runner.
To run the E2E tests in CI mode, run npm run build:ci
then run ./tasks dojo-test-e2e
. If you'd like to run the E2E tests in CI mode and open the Cypress test runner, run npm run build:ci
and then npm test:e2e:open
.
If Cypress has not been fully installed by npm you can force it to install the cypress binary by running ./node_modules/.bin/cypress install
.
When updating for a new month the keys will need to be changed in s3-config.json and steps 3-4 above will need to be rerun.