The application that runs on the SFU CSSS's common room touchscreen. It uses Angular for the frontend and Express for the proxy server.
You will need node.
The repository is an npm workspace containing the Angular frontend and Express proxy server.
-
Clone the repository.
-
Install all workspace dependencies from the repository root.
# in path/to/csss-site-kiosk npm install -
Create
server/.envby copyingserver/.env.example. See Environment variables for the available settings.
The frontend API client is generated automatically before frontend start and build commands. By
default it uses the OpenAPI document from @sfucsss/backend-openapi. To generate from a CSSS
backend running locally instead, run npm run api:url from the repository root.
Make sure you've completed Setting up your environment first.
There are several root-level commands depending on the part of the application you are working on.
The frontend sends requests based on the file selected from frontend/src/environments/.
By default the application is available at http://localhost:8080.
Build the frontend and start the Express server:
npm startFor development, run the production frontend build watcher and Express server together:
npm run devUse this if you only need to work on the UI.
- The frontend will be built using its
developmentenvironment. - The frontend will send requests directly to
localhost:3049.
# in path/to/csss-site-kiosk
npm run start:frontendUse this if you need the proxy server running as well.
- The proxy serves the latest build from
frontend/dist/csss-site-kiosk/browser/. - The frontend will be built using the
productionenvironment and send requests tolocalhost:SERVER_PORT(default 8080). - The proxy will send requests to
PROXY_TARGET(defaultlocalhost:3049).
# in path/to/csss-site-kiosk
npm run build
npm run start:serverThere are two sets of environment variables: one for the frontend and one for the proxy. The frontend environment defaults can be found in frontend/src/environments.
| Variable | Default (development) | Description |
|---|---|---|
| production | false |
The environment the frontend assumes it's in. |
| csssApiUrl | http://localhost:3049/api |
The target for requests going to the CSSS backend server. |
| appUrl | http://localhost:8080 |
The URL this server is served from. |
The proxy server uses server/.env.
| Variable | Default | Description |
|---|---|---|
| NODE_ENV | development |
The environment the proxy assumes it's in. |
| KIOSK_API_SECRET | secret_on_backend |
The authorization bearer key that the CSSS backend server will use to authenticate requests. |
| PROXY_TARGET | http://localhost:3049 |
Where the proxy will forward its requests to. |
| SERVER_PORT | 8080 |
The port the proxy will be served from. |