UI service for interfacing with InferESG.
- Ensure the
.envfile has been configured as described in the main README.
This README covers instructions on how to run the application:
- Locally
- In a Docker Container
For ease of use, we would recommended that you run the entire application using Docker Compose instead. See main README.
If you would prefer not to use Docker Compose, read on...
- Change directory to the
/frontendspace, then run the following to install the dependencies
npm install- Run the app using
npm startCheck the frontend app is running at http://localhost:8650
- Build the Docker image
docker build -t {my-frontend-image-name} .- Run the app within a Docker container
docker run --env-file ../.env -p 8650:8650 {my-frontend-image-name}Note that we pass in the entire environment file that contains all our application's configuration. This means some unnecessary configuration is also being passed in. This is fine when testing locally. In production, we must limit this to only the essential frontend configuration (see environment configuration within Docker Compose).
Check the frontend app is running at http://localhost:8650
We have set up ESLint for the frontend code. To run the linter, use the following command:
npm run lintThis will attempt to fix any errors you have and will also show you any errors that it can't fix. To automatically fix errors on save (for vscode) do the following:
- create a
.vscodefolder in the root of the project - create a
settings.jsonfile in the.vscodefolder - add the following to the
settings.jsonfile:
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}