This codebase contains both a Scala backend and a React frontend for the DRT Dashboard application. The frontend is built using Create React App and communicates with the Scala backend via RESTful APIs.
To run the backend enter the root of the codebase and run:
USE_PG_SSL=false \
USE_PG_SSL_MODE=disable \
AWS_ACCESS_KEY_ID=xx \
AWS_SECRET_ACCESS_KEY=xx \
AWS_S3_BUCKET=drt-local \
TEAM_EMAIL=x@x \
ACCESS_REQUEST_EMAIL=y@y \
DRT_DOMAIN=drt.localhost \
GOV_NOTIFY_API_KEY=xx \
KEY_CLOAK_API_URL= \
KEY_CLOAK_TOKEN_URL=https://localhost \
KEY_CLOAK_CLIENT_ID=drt-acp \
KEY_CLOAK_CLIENT_SECRET= \
KEY_CLOAK_USERNAME= \
KEY_CLOAK_PASSWORD= \
NO_JSON_LOGGING= \
ENABLED_PORTS=stn,lcy,ltn,nwi,sen,bhx,ema,lhr \
SLACK_WEBHOOK_URL= \
sbt runFrom the repository root you can run the standard backend verification script:
./run_tests.shThe script changes to the repository root and runs the conservative SBT verification flow used for local build cleanup checks:
sbt clean scalafmtAll compile coverage test coverageOff coverageReport dependencyUpdatesUse this script when you want to verify formatting, compilation, test execution, coverage report generation, and dependency update reporting in one step.
Navigate to the react directory and install dependencies:
Then start the app:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
INJECT_TEST_HEADERS true/false determines whether the frontend will inject extra headers (X-Forwarded-Email and X-Forwarded-Groups) into the API requests (to surpass the authentication mechanism when running locally only).
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.