DualMind Lab uses a split deployment: backend on Azure App Service, frontend and admin on Cloudflare Workers. Database is managed by Supabase.
Architecture overview
| Component | Platform | URL |
|---|---|---|
| Backend API | Azure App Service | https://api.dualmindlab.tech |
| Frontend | Cloudflare Workers | https://arena.dualmindlab.tech |
| Admin Panel | Cloudflare Workers | Separate Workers project |
| Database | Supabase (hosted PostgreSQL) | https://calqfzajyidkdzbaswjp.supabase.co |
Backend deployment (Azure)
- GitHub Actions (CI/CD)
- Manual
- Docker
The backend auto-deploys via GitHub Actions on push to
main:Environment variables (Azure)
Set these in Azure App Service → Configuration → Application settings:| Variable | Required | Description |
|---|---|---|
SUPABASE_URL | Yes | Supabase project URL |
SUPABASE_SERVICE_ROLE_KEY | Yes | Service role key for DB access |
JWT_SECRET | Yes | JWT secret for token validation |
GROQ_API_KEY | Optional | Groq API key (overrides DB keys) |
ASPNETCORE_ENVIRONMENT | Recommended | Set to Production |
Frontend deployment (Cloudflare Workers)
Prerequisites
- Cloudflare account with Workers enabled
wranglerCLI authenticated (npx wrangler login)
Deploy
Configuration
Updateconfig.js before deploying to ensure production URLs:
worker.js) proxies /api/* requests to the backend and serves static files for everything else.
Admin panel deployment
BACKEND_URL in Cloudflare Workers environment:
Supabase configuration
Required tables
Ensure all tables exist in thepublic schema. See Database Schema for complete definitions:
users,ai_models,threads,thread_messagescomparisons,model_votes,providers,provider_api_keyssystem_settings
Row-Level Security (RLS)
If RLS is enabled on tables, ensure the service role key bypasses RLS or appropriate policies are in place. The backend uses the service role key which bypasses RLS by default.Feature flags
Insert intosystem_settings:
Monitoring
Backend Logs
Azure App Service → Log Stream for real-time logs. Each request logs correlation ID, method, path, duration, and status code.
Health Checks
GET /health— basic API healthGET /api/health— alias endpointGET /api/arena/ping— arena subsystem
Swagger UI
Available at
/swagger in all environments. Useful for quick API testing and exploration.