/enki

Front-end for Nplan

Primary LanguageTypeScriptEuropean Union Public License 1.2EUPL-1.2

Enki

Build Quality Gate Status

Frontend app for Nplan - a simple timetable editor. Backend is Uttu.

Development

To run for development, simply do:

npm install
npm start

Note: The app uses Node version 18 (LTS).

To run together with a local instance of Uttu on port 11701, add the following to .env.development.local.

REACT_APP_UTTU_API_URL=http://localhost:11701/services/flexible-lines

Configuration

Configuration is bootstrapped from /bootstrap.json, when the app loads. You should add your environment-specific config to the deployment, along with the built static files (i.e. in the build/ folder).

For local development, add a bootstrap.json file to the public/ folder.

See src/config/ConfigContext.ts for the shape of the configuration.

Authentication

Uses OIDC for authentication. This solution is agnostic to which authentication provider you use.

Example configuration (works with Auth0):

{
  "oidcConfig": {
    "authority": "https://<authentication domain>",
    "client_id": "<client id>",
    "extraQueryParams": {
      "audience": "<example audience>"
    }
  }
}

For full configuration reference, see oidc-client-ts documentation.

Bypass authentication locally

It's possible to bypass authentication locally with the configuration parameter disableAuthentication set to true. This can be used in combination with the local-no-authentication profile in the backend.

Testing

Uses Jest for unit and reducer testing.

npm test