This is an admin for OS2Display. This is based on create-react-app. See https://github.com/os2display/display-docs/blob/main/admin.md for a description of the admin.
By default the api that is requested is located at /api/
.
This can be configured by:
cp public/example_config.json public/config.json
And modify the entries to suit your setup.
{
"api": "[WHERE TO FIND THE API]"
}
This file contains the access config. This file is only required if other access setting are required than what is default.
cp public/example-access-config.json public/access-config.json
docker compose up --detach
docker compose run --rm node yarn install
Note: When to node
container is running, the JavaScript is continously
being built.
The communication with the API is generated from an OpenAPI specification with Redux Toolkit.
To regenerate (when the API specification has changed):
# Action: Replace api.json with the new api.json OpenAPI specification
# Install and run scripts to generate ned Redux Api slices.
docker compose exec node npm --prefix src/redux/api install
docker compose exec node npm --prefix src/redux/api start
We use cypress for testing.
To run cypress tests in the cypress container:
docker compose run --rm cypress run
docker compose run --rm node yarn check-coding-standards
docker compose run --rm node yarn apply-coding-standards