Stack
DualMind Lab’s frontend is a vanilla JavaScript application with no build step. It uses ES modules, custom CSS, and is served via Cloudflare Workers in production.Key files
API client
TheDualMindApi class provides a clean interface to the backend:
Configuration
All runtime configuration is inconfig.js via window.DUALMIND_CONFIG:
apiBaseUrl— Auto-detected:localhost:5079for dev,api.dualmindlab.techfor productionsupabase.url/supabase.anonKey— Supabase project credentialsstreaming.enabled— SSE streaming toggle (default:true)features.*— Feature flags for streaming, voting, threads, leaderboardspeedPreset—'fast','balanced', or'quality'presets
Auth flow
- User visits
/loginpage - Clicks “Login with Google” → Supabase OAuth redirect
- After consent, redirected back with JWT in URL hash
- Supabase JS client stores session (localStorage)
- All subsequent API calls include
Authorization: Bearer <jwt>header automatically viaHttpClient