Floor plans of the building with every room outlined, for recording which unit stewards each room and what it's used for.
In the Controls panel, pick a steward (replaces the room's steward) or a label (toggles it on the room), and click rooms on the plan or in a floor's table. Stewards, labels and their colours come from public/assets/config.json.
Unsaved changes are kept in the browser. The Save & Sync tab saves them:
- GitHub: saves are committed to a branch for that user,
edits/<login>, on the upstream repository (github.upstreaminconfig.json), credited to them with aCo-authored-byline. Users can also attach files to propose, such as a newer floor plan image or aspace.jsonwith updated room shapes. After saving, the app offers to share the changes, which opens a pull request for the maintainers to review. Later saves are added to that pull request. Once it's merged, the next save starts the branch afresh from the default branch. - Solid pod: signs in with the user's identity provider (OIDC with PKCE) and stores every room's stewards and labels in
cise-space-size/annotations.jsonin their pod (solid.pathinconfig.json). - Download space.json: the current data, to commit by hand.
When you sign in, the app loads what you last saved there.
Signing in only proves who the user is: it asks for no permissions, so GitHub shows just "verify your identity" and the user's token can't change anything. All writing is done by a GitHub App installed on the upstream repository alone, with only Contents and Pull requests access. A small backend (server/) checks who the user is on every request and then writes with the app's credentials. The same code runs in the Vite dev server (npm run dev) and as a Cloudflare Worker (server/worker.ts).
- Create the GitHub App (your organization's Settings → Developer settings → GitHub Apps → New GitHub App, so it can be installed on the organization's repository):
- Callback URLs: add both
http://localhost:5173/andhttps://cise.mhciael.com/(a GitHub App can have several). - Expire user authorization tokens: on. Request user authorization (OAuth) during installation: off.
- Webhook: untick Active.
- Repository permissions: Contents: Read and write, Pull requests: Read and write (Metadata: Read-only is added automatically). Account permissions: none.
- Where can this GitHub App be installed: only on this account.
- Callback URLs: add both
- On the app's page, note the App ID and Client ID, generate a client secret, and generate a private key (a
.pemfile; keep it outside the repository). - Install the app (Install App → the organization → Only select repositories →
cise-space-size). - Set
github.upstreaminpublic/assets/config.json, e.g."JMU-CS/cise-space-size". - Local development: copy
.env.exampleto.env.development.localand fill it in. Restartnpm run dev. - Deployment: the frontend and the backend are deployed separately.
- Frontend (GitHub Pages):
.github/workflows/pages.ymlbuilds the app and publishes it on every push tomain, so merged pull requests go live within a few minutes. In the repository settings, set Pages → Source to GitHub Actions, and add the Actions variableVITE_GITHUB_CLIENT_ID(andVITE_API_BASEif the backend isn't athttps://cise-api.mhciael.com).public/CNAMEsets the custom domain, which needs a DNSCNAMErecord pointingcise.mhciael.comatjmu-cs.github.io. - Backend (Docker): the
Dockerfilerunsserver/bun-server.ts, which serves/api/*with the same code as the worker (it also serves the built app, so one container can host everything). Run it withGITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,GITHUB_APP_ID,GITHUB_APP_PRIVATE_KEY_FILE(orGITHUB_APP_PRIVATE_KEY) andALLOWED_ORIGIN=https://cise.mhciael.com, behind a reverse proxy with HTTPS atcise-api.mhciael.com. For example:Saves can be up to 50 MB, so allow request bodies that large in the proxy.docker build -t cise-space-size . docker run -p 8080:8080 --env-file .env -e ALLOWED_ORIGIN=https://cise.mhciael.com \ -e GITHUB_APP_PRIVATE_KEY_FILE=/key.pem -v "$PWD/app.private-key.pem:/key.pem:ro" cise-space-size
- Alternatively, a Cloudflare Worker: fill in the
[vars]inserver/wrangler.toml, thenRouted on the app's own domain atnpx wrangler deploy --config server/wrangler.toml npx wrangler secret put GITHUB_CLIENT_SECRET --config server/wrangler.toml npx wrangler secret put GITHUB_APP_PRIVATE_KEY --config server/wrangler.toml < path/to/app.private-key.pem/api/*, the app needs no extra settings beyondVITE_GITHUB_CLIENT_IDat build time. On another origin, setALLOWED_ORIGINon it andVITE_API_BASEin the build.
- Frontend (GitHub Pages):
Anyone with a GitHub account can propose changes; set ALLOWED_USERS (comma-separated logins) on the server to limit who can. Proposals can touch any file in the repository but only ever land on edits/<login> branches, so nothing reaches the default branch without a maintainer merging a pull request. The app has no Workflows permission, so GitHub rejects changes to .github/workflows.
The user's token is kept in the browser's local storage until they sign out or it expires (8 hours), after which they sign in again.
Nothing to configure: users type or pick their identity provider (the list is solid.issuers in config.json).
scripts/extract_rooms.py and scripts/build_space.py generate the room polygons in space.json from the plan images. Rebuilding keeps each room's stewards, labels and notes.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])