Frontend app for Nplan - a simple timetable editor. Backend is Uttu.
To run for development, simply do:
npm install
npm start
See http://localhost:3001/providers or http://localhost:3001/lines for providers and lines.
Note: The app uses Node version 24 (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 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, e.g.:
$ cp .github/environments/local.json public/bootstrap.json
See src/config/ConfigContext.ts for the shape of the configuration.
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.
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.
Translation files are split into separate chunks and loaded on demand. To eliminate a round-trip on initial page load, you can set the PRELOAD_LOCALE environment variable at build time:
PRELOAD_LOCALE=nb npm run build
This injects a <link rel="modulepreload"> tag for the matching translation chunk into index.html, so the browser fetches and parses it early. If the variable is not set, the build output is unchanged.
Uses Jest for unit and reducer testing.
npm test