Technology summary
| Aspect | Choice |
|---|---|
| Language | Vanilla JavaScript (ES modules) |
| Framework | None — plain HTML/CSS/JS |
| Bundler | None — served directly via npx serve or Cloudflare Workers |
| Hosting | Cloudflare Workers (production) / serve (local dev) |
| Auth | Supabase JS client (@supabase/supabase-js via CDN) |
| Styling | Custom CSS with multiple stylesheets |
| Icons | Font Awesome |
Directory structure
API client architecture
TheDualMindApi class is the single entry point for all backend communication.
DualMindApi.js
Usage pattern in frontend code
Global configuration
Theconfig.js file sets window.DUALMIND_CONFIG which controls all runtime behavior:
config.js
Authentication flow
Page routing
The frontend uses file-based routing with separate HTML files:| Path | File | Purpose |
|---|---|---|
/ | index.html | Main chat/arena page |
/login | login/index.html | Authentication page |
/leaderboard | leaderboard/index.html | Model rankings |
/models | models/index.html | Browse available models |
/share | share/index.html | View shared threads |
/about | about/index.html | About page |
/careers | careers/index.html | Careers page |
Cloudflare Worker (production serving)
Theworker.js handles production deployment:
- API proxy:
/api/*requests are forwarded toBACKEND_URL(Azure backend) - Static serving: All other requests served from Cloudflare Workers Sites (KV)
- Clean URLs: Extensionless paths resolve to
.htmlfiles - SPA fallback: Unmatched routes return
index.html
worker.js