This guide provides information on how to build and deploy TermIt UI.
- NodeJS 12.x or later
- npm 6.x or later
To build TermIt for non-development deployment, use the build-prod
npm script.
The following parameters can be configured for the build:
Parameter | Type | Default | Description |
---|---|---|---|
REACT_APP_SERVER_URL |
string |
- | Specifies the URL where the TermIt backend is running |
REACT_APP_DEPLOYMENT_NAME |
string |
'' |
Is used to disambiguate cookies and items in the local storage in case the client accesses multiple TermIt instances |
REACT_APP_ADMIN_REGISTRATION_ONLY |
boolean |
false |
Configures whether the login page should contain a link to registration or not. If the parameter is true, only administrators can add new users and there is no registration link |
REACT_APP_SHOW_PUBLIC_VIEW_ON_UNAUTHORIZED |
boolean |
false |
Configures whether the application should show the public view dashboard if the user is not logged in. By default, the login screen is shown. |
REACT_APP_AUTHENTICATION |
string |
'' |
Authentication means. Use keycloak to set up Keycloak-based authentication (must be configured on backend as well. |
REACT_APP_KEYCLOAK_URL |
string |
'' |
URL of the Keycloak authentication service. Relevant only if Keycloak-based authentication is enabled. |
REACT_APP_KEYCLOAK_REALM |
string |
'' |
Name of the Keycloak realm under which this application authenticates its users. Relevant only if Keycloak-based authentication is enabled. |
REACT_APP_KEYCLOAK_CLIENTID |
string |
'' |
Keycloak client identifier of this appliation. Relevant only if Keycloak-based authentication is enabled. |
npm install
REACT_APP_SERVER_URL=https://kbss.felk.cvut.cz/termit-server-dev REACT_APP_DEPLOYMENT_NAME=dev REACT_APP_ADMIN_REGISTRATION_ONLY=true npm run build-prod
Deployment is fairly simple, just take the content of the build
folder generated by the build script
and copy it to a location accessible via HTTP(S), e.g., into an Apache HTTP server-managed location.
cp -R build /var/www/termit/
TermIt can operate in one of two authentication modes - using its internal user database and authentication means (default) or via Keycloak. Corresponding parameters (service URL, realm, clientId) need to be set up when using Keycloak authentication (see the table above for the relevant parameters and explanation).