Skip to main content

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

The DualMindApi class provides a clean interface to the backend:

Configuration

All runtime configuration is in config.js via window.DUALMIND_CONFIG:
  • apiBaseUrl — Auto-detected: localhost:5079 for dev, api.dualmindlab.tech for production
  • supabase.url / supabase.anonKey — Supabase project credentials
  • streaming.enabled — SSE streaming toggle (default: true)
  • features.* — Feature flags for streaming, voting, threads, leaderboard
  • speedPreset'fast', 'balanced', or 'quality' presets

Auth flow

  1. User visits /login page
  2. Clicks “Login with Google” → Supabase OAuth redirect
  3. After consent, redirected back with JWT in URL hash
  4. Supabase JS client stores session (localStorage)
  5. All subsequent API calls include Authorization: Bearer <jwt> header automatically via HttpClient

Pages