build.js copies a fixed list of files and folders into dist/, and the dualmind-arena Worker serves them.
Layout
DualMind_UI
index.html
config.js
js
api
auth
ui
feature-flags.js
components
css
leaderboard
share
waitlist-worker
build.js
worker.js
wrangler.jsonc
Talking to the API
config.js sets one base URL: http://localhost:5079 on localhost, https://api.dualmindlab.tech everywhere else. All calls go through HttpClient:
- adds
Authorization: Bearer <access token>from the Supabase session, - 30 s default timeout (battles pass longer ones), 2 retries with exponential backoff and jitter for network errors,
- JSON in and out, with
extractChatResponse/extractDualChatResponsenormalising response shapes.
The Worker
This is
worker.js on the repository’s main branch. Static assets are served first, so /, /leaderboard/ and every file in dist/ load normally, and only paths that don’t match a file reach the Worker. The Worker also has a Flagship feature-flag binding that was used for the waitlist routing. The deployed version can lag the repository, so check it with npx wrangler deployments list before relying on this behaviour.Build, lint and test
.github/workflows/ci.yml) runs pnpm install --frozen-lockfile, lint and node build.js on pushes and pull requests to main and master, and uploads dist/ as an artifact. Deploys are manual (pnpm run deploy, which builds and runs wrangler deploy); see Deploy and operate.
Supabase pieces the arena uses
- Auth with Google OAuth and email/password, plus the
auth-callback,auth-verifyand password reset pages. - The
email-wel-safeEdge Function for welcome emails. - The
avatarsstorage bucket for profile pictures.