Skip to main content

Technology summary

Directory structure

API client architecture

The DualMindApi class is the single entry point for all backend communication.
DualMindApi.js

Usage pattern in frontend code

Global configuration

The config.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:

Cloudflare Worker (production serving)

The worker.js handles production deployment:
  1. API proxy: /api/* requests are forwarded to BACKEND_URL (Azure backend)
  2. Static serving: All other requests served from Cloudflare Workers Sites (KV)
  3. Clean URLs: Extensionless paths resolve to .html files
  4. SPA fallback: Unmatched routes return index.html
worker.js