Hub
The hub reads commands using its own restricted Supabase login and passes them to the terminal through the SDK. It spools scans locally before acknowledgment.
From the root run npm run build --workspace sdk, then
npm run build --workspace hub. Copy hub/.env.example to hub/.env.
Set the project URL, public publishable key, restricted hub email/password,
terminal's reserved private IP and DATA_DIR.
Create one new hub account using the setup script in a protected terminal. If an account already exists, recover that account rather than creating another. Never use the service-role key in the hub.
npm start --workspace hub
Android
Termux and Termux:Boot must come from a compatible trusted source. Node and
production packages run in Termux private storage. Termux:API is optional for
battery telemetry. The extracted hub now needs the SDK too: copy/build both
sdk and hub at the same relative locations, not only the hub's dist.
Alternatively install a packed SDK tarball as the hub dependency.
Disable battery restrictions, configure autostart and a wake lock, and test a reboot plus a long screen-off run before relying on the phone. Do not assume an untested phone is reliable. Keep credentials protected and the phone charged.
Private network or server
Reserve device IPs. Record the old terminal server settings for rollback before pointing it at the hub on port 7788. The protocol is not encrypted or authenticated; keep it on an isolated network. A server outside the gym needs a router/private tunnel, firewall rules and latency/recovery tests.
Names remain off unless HUB_SET_NAMES=1 after validation. Unknown payloads
must never be sent to analytics, logs or the app. SDK metadata-only diagnostics
are not permission to capture raw templates.