Web server serving the establishment facing UI for managing licences
To run a local instance:
npm run dev
To rebuild js and css assets:
npm run build
@asl/service/ui
provides the common ui boilerplate - auth, sessions, static asset serving, CSP etc.@asl/pages
provides the react components for the pages and layouts
The service can be configured for local development by setting environment variables in a .env
file.
The following environment variables are required:
API_URL
- the hostname of the downstream API serviceSESSION_SECRET
- an arbitrary string used to sign session dataJWT_SECRET
- secret used to sign invitation tokens. Needs to match the same variable inasl-resolver
.KEYCLOAK_REALM
- the keycloak realm used for authenticationKEYCLOAK_URL
- the url of the keycloak serverKEYCLOAK_CLIENT
- the client name used to authenticate with keycloakKEYCLOAK_SECRET
- the secret used to authenticate with the keycloak clientPERMISSIONS_SERVICE
- the hostname of the downstream permissions servicePDF_SERVICE
= the hostname of the html to pdf serviceBODY_SIZE_LIMIT
= the size limit for body parser (PPL updates only)
The following environment variables can be optionally defined:
PORT
- port that the service will listen on - default8080
REDIS_HOST
- host of the redis server used for session storage - defaultlocalhost
REDIS_PORT
- port of the redis server used for session storage - default6379
REDIS_PASSWORD
- password of the redis server used for session storage - defaultundefined
VERBOSE_ERRORS
- show verbose errors in client. Defaultundefined
INTERNAL_URL
- the hostname of the internal facing ui - defaultundefined
None
The following services must be available in order to run:
asl-public-api
- to access licence dataredis
- to store serialised session dataasl-permissions
- to authenticate user tasks
Very little code actually resides in this repo, so development is most likely to occur on one of the dependent modules.
To link a local development version of a dependency - in this example @asl/pages
:
# in the module's directory - e.g. ~/dev/asl-pages
npm link
# in this project's directory
npm link @asl/pages
This will then use your local version of @asl/pages
when you require('@asl/pages')
.
Note: if you run npm install [pkg]
then this will undo the linking and revert to the npm registry version, so you will need to re-execute the second command above.
If you are working in a linked version of @asl/pages
you will likely need to recompile js assets when you make changes. To do this run:
npm run build:js -- --watch
To force the server to restart on changes watch your linked directory:
npm run dev -- -w ../path/to/asl-pages
To run basic tests including eslint and unit tests:
npm test
To run the full functional test suite in an automated browser:
npm run test:functional:local