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 the repository-pinned Node version. Node runs the Express server's TypeScript source directly during development using native type stripping. The repository is an npm workspace containing the Angular frontend, Express proxy server, and source-only shared types.
-
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 devThis watches both the frontend build and server/server.ts.
Use 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:serverThe root build compiles the frontend and emits the production server entrypoint to
server/dist/server.js.
The @csss-kiosk/shared workspace contains compile-time types only. Always import from it with
import type so no shared runtime dependency is emitted. Relative imports between server source
files must include their .ts extension: Node can then run the source directly, while TypeScript
rewrites those extensions to .js during production builds.
There 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. |
| mediaUrl | /media |
The base URL the images are fetched 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. |