Skip to main content
DualMind Lab

What is DualMind Lab? v2.0

DualMind Lab is an AI model comparison platform that allows users to compare two or more AI models side-by-side with random or blind selection, vote on which response is better, and track model performance on a community-driven .
Blind comparison eliminates brand bias — users don’t see which model generated which response until after voting.

Dual-Chat Arena

Send one prompt to two randomly selected AI models and compare responses side-by-side in a blind test

Community Voting

Vote for the better response. Votes feed into an ELO-based leaderboard that ranks model performance

Thread Management

Persistent conversation threads with visibility controls (private, public, unlisted) and sharing

Multi-Provider AI

Groq and Bytez providers with automatic key rotation, failover, and fallback logic built in

Technology stack

LayerTechnologyDetails
Backend.NET 8 / C# / ASP.NET CoreREST API with Swagger, hosted on Azure
DatabasePostgreSQL via SupabaseAll data: users, threads, comparisons, votes, models
AuthSupabase Auth + JWTHS256 tokens, sub claim = user ID
FrontendVanilla JS + HTML/CSSServed via Cloudflare Workers, SSE streaming
Admin PanelVanilla JS + Cloudflare WorkersProxies /api/* to backend, serves static HTML
AI ProvidersGroq, BytezOpenAI-compatible chat completions API

How it works

Quickstart

Clone repos, configure environment, run locally in under 15 minutes

Architecture Overview

System diagrams, component interactions, and technology breakdown

API Reference

All endpoints with interactive playground and multi-language examples

Database Schema

Complete table definitions, ER diagrams, and relationships

Repository structure

DualMind Lab is a multi-repo project with three main repositories:

Backend API

DualMind_Back — .NET 8 REST API with JWT auth, AI provider gateway, and Supabase data access

Frontend

DualMind UI — Vanilla JS SPA with SSE streaming, served via Cloudflare Workers

Admin Panel

DualMind Admin UI — Cloudflare Worker dashboard with full CRUD for all entities

Authentication

All API endpoints (except health checks and feature flags) require a Supabase JWT token:
Authorization: Bearer <SUPABASE_JWT_TOKEN>
  1. Sign in via the frontend using Google OAuth or email/password
  2. Supabase Auth issues a JWT with sub (user UUID), email, and aud: "authenticated"
  3. The frontend stores the token via supabase.auth.getSession()
  4. All API requests include the token in the Authorization: Bearer header
const { data: { session } } = await supabase.auth.getSession();
const token = session?.access_token;

const response = await fetch('/api/arena/chat', {
  headers: { 'Authorization': `Bearer ${token}` }
});
The backend validates every JWT using HS256 with the Supabase project’s JWT secret:
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddJwtBearer(options => {
        options.TokenValidationParameters = new TokenValidationParameters {
            ValidateIssuer = true,
            ValidIssuer = $"{supabaseUrl}/auth/v1",
            ValidateAudience = true,
            ValidAudience = "authenticated",
            ValidateLifetime = true,
            IssuerSigningKey = new SymmetricSecurityKey(
                Encoding.UTF8.GetBytes(jwtSecret))
        };
    });
The JWT secret must match your Supabase project exactly. Find it in Supabase Dashboard > Settings > API > JWT Secret.

Explore the docs

Press Cmd + C (Ctrl + C on Windows) on any page to copy it as Markdown for AI tools. Or use the contextual menu to send pages directly to ChatGPT, Claude, or Perplexity.
Ready to start? Head to the Quickstart guide, explore the Architecture, or jump to the API Reference.