Concord is a mobile-first React demo for a smart apartment platform that acts on resident patterns, explains why, accepts corrections, and keeps safety rules authoritative. It includes resident, visitor-access, operator and handover flows.
Requirements: Node.js 20+.
npm install --legacy-peer-deps
npm run devProduction build and local preview:
npm run build
npm run preview -- --port ${PORT:-4192}Use the presentation command when you need the remote demo:
npm run presentIt builds Concord, blocks lid-close/idle suspend, starts the app and live in-memory engine
on one origin, then opens a free Cloudflare Quick Tunnel. Share the printed
https://…trycloudflare.com URL. Keep that terminal running; press Ctrl+C to stop the
tunnel, server and keep-awake block together. Quick Tunnel URLs are temporary and change
when restarted. Presentation mode uses local port 8791 by default so it can coexist with
the development engine on 8787; override it with PORT=9000 npm run present if needed.
npm run relay remains available when a keep-awake block is not wanted.
The public URL is also the API base, so commands sent from any machine update the same state the open browser polls and renders in the 3D apartment:
PUBLIC_URL=https://example.trycloudflare.com
curl -sS "$PUBLIC_URL/commandDevice" \
-H 'content-type: application/json' \
--data '{"deviceId":"dev_light_living","set":{"on":false,"brightness":20},"requestId":"demo-light-1"}'For local production without a tunnel, run npm run build && npm start. Override the
single server port with PORT=8790 npm start.
The existing workspace install was assembled from already-cached local packages after registry.npmjs.org timed out. A normal install should use the package versions in package.json when registry access is available.
The UI always uses the live HTTP adapter in src/data/httpAdapter.ts. Development defaults
to http://localhost:8787; production defaults to the page's own origin so a relay serves
the UI and API together. VITE_ENGINE_URL can override either. API.md documents
the engine surface; components call it through src/data/adapter.ts and never use mocks.
An optional local demo engine exists under engine/ and starts with:
npm run engineIt uses PORT (default 8787) and in-memory state. It is demo scaffolding, not authentication, durable storage, or a production safety system.
- Emergency actions notify a simulated building desk; they do not contact emergency services.
- QR passes are real encoded SVGs for the demo flow, but secure server-side redemption is pending backend integration.
- Resident/operator switching is an explicit demo view, not authentication.
- No analytics, optional storage, cookies, or external assets are loaded.
From the workspace root, run shared visual QA against a production preview:
node scripts/screenshot.mjs http://127.0.0.1:4192 sites/concord/qa
node scripts/motion-qa.mjs http://127.0.0.1:4192 sites/concord/qa/motionFrom this directory:
node qa/interaction.mjs http://127.0.0.1:4192
node qa/scene.mjs http://127.0.0.1:4192
node qa/text-floor.mjs http://127.0.0.1:4192