Place this file at the repo root (remote-access-app/CLAUDE.md). Claude Code reads
it automatically each session.
BizGaze Connect — a no-install, browser-based remote support / screen-sharing tool for the BizGaze ecosystem. A customer opens a page, gets a 6-digit code; a signed-in BizGaze agent enters the code, the customer taps Allow, and the agent sees the customer’s screen with two-way voice + chat. Live at remote.bizgaze.com. Roadmap: grow into a communication platform (meetings + persistent chat) for registered BizGaze users.
ws (WebSocket).node:sqlite (no native modules). DB file: server/data.db.<style> and <script>. Do not introduce React/bundlers.server/
server.js # thin entry: HTTP dispatch + WS attach + listeners (HTTP/HTTPS)
config.js # env + filesystem paths (PORT, dirs, SESSION_TTL)
lib.js # HTTP helpers: json / readBody / parseCookies / now
session.js # currentUser (cookie -> user) + audit()
presence.js # shared in-memory live state (onlineAgents/liveSessions/pendingShares)
routes.js # HTTP JSON API (/api/*, /sso) -> { "METHOD /path": handler } map
static.js # static file serving + authenticated recording/transcript downloads
signaling.js # WebSocket signaling (consent + SDP/ICE relay)
repos.js # data-access layer — ALL SQL lives here (tenant-scoped)
bizgaze.js # BizGaze identity provider (validate login, env-gated)
db.js # node:sqlite schema + idempotent migrations
auth.js # scrypt hashing, token/id generation, TOTP helpers
package.json # { "dependencies": { "ws": "^8.18" }, engines node>=22.5 }
test/e2e.js # 21-check backend e2e (register->login->session->signaling->audit)
public/
index.html # public landing (Log in with BizGaze / share without login)
home.html # post-login shell: chat rail + Share/Connect (iframe) + Meeting (/home)
dashboard.html# login + role-scoped session report (/dashboard, replaces /console)
connect.html # agent: enter code, view screen, control bar (/connect)
share.html # customer: get code, share screen (/share)
home-mockup.html # locked design reference for home
logo.png
recordings/ # saved session recordings (.webm) [created at runtime]
transcripts/ # saved transcripts (.txt) [created at runtime]
Architecture/roadmap detail lives in ARCHITECTURE.md. Backend SQL must go through
repos.js (never inline in routes/signaling). Run node test/e2e.js after backend edits.
cd server && npm install && node server.js
# HTTP on :8090 (HTTPS on :8443 only if cert.pem + key.pem exist in server/)
# Env: ALLOW_REGISTRATION=1 opens the first-team registration
First registered user becomes admin; registration then closes (unless ALLOW_REGISTRATION=1).
POST /api/register|login|logout, GET /api/me, GET/POST /api/users,
POST /api/users/manage, GET /api/setup-state, GET /api/reportGET /api/ice — returns STUN, plus managed TURN only for mobile clients
(TURN creds come from env: TURN_URLS, TURN_USERNAME, TURN_CREDENTIAL)POST /api/recording?sessionId= / POST /api/transcript?sessionId= — uploadsGET /recordings/<sid>.webm / GET /transcripts/<sid>.txt — authed downloads (streamed w/ Content-Length)GET /sso?token= — SSO entry (HMAC today; JWT migration planned)/, /console, /connect, /share/ws)liveSessions map (sessionId -> {agentWs, viewerWs, …}). Message cases:
agent-hello, viewer-connect, consent, share-create, code-connect,
offer/answer/ice-candidate (relayed peer-to-peer), recording, transcript,
end-session. Keepalive ping every 25s. Media never traverses the server.
.webm; downloadable from the report. Customer sees a “being recorded”
banner + live timer..txt (voices + chat) uploaded; downloadable from the report.getDisplayMedia screen capture to web pages. Only a native app can
capture a phone screen. The share page detects mobile and shows a clear message.
(Desktop screen share works fully.)getDisplayMedia is called directly from
the customer’s “Allow” tap (see share.html beginCapture).remote.bizgaze.com, Linux, Docker, behind a reverse proxy./ws with long timeouts; allow large bodies on
/api/recording; not buffer /recordings/ downloads. (See IT-HANDOFF-PROXY.md.)TURN_URLS, TURN_USERNAME, TURN_CREDENTIAL (Metered TURN),
SSO_SECRET, BIZGAZE_WEBHOOK_URL, BIZGAZE_LOGIN_URL (identity provider for /api/login),
ALLOW_REGISTRATION, DB_PATH, PORT, HTTPS_PORT./sso verifies it and creates a local session. Supports both
“from inside BizGaze” and a “Log in with BizGaze” button at our URL. Waiting on
the dev team for: shared secret, token format (JWT preferred), SSO start URL,
signup URL, role mapping. (See BizGaze-Connect-SSO-SPEC.md.)After login, replace the current dashboard with a BizGaze Connect “home”:
public/home-mockup.html) to lock
the layout, then wire the real tabs/sidebar. Keep the single-file, no-framework style.#1F3B73, yellow #FFC708, logo at /logo.png.profileHTML()/wireProfile() and
brand patterns already in console.html/connect.html.node --check extracted inline scripts after edits; test against a local
node server.js before committing.