Skip to main content
Time estimate: ~15 minutes. You will have a fully working DualMind Lab instance with chat, arena comparisons, and voting.

Prerequisites

Download from dotnet.microsoft.com
dotnet --version
# Should output: 8.0.x
Download from nodejs.org
node --version && npm --version
Create a free project at supabase.com. You need:
  • Project URL (e.g., https://xxx.supabase.co)
  • Anon key (Settings > API)
  • Service role key (Settings > API)
  • JWT secret (Settings > API > JWT Secret)
Save the JWT Secret immediately — you cannot retrieve it later without resetting it.
Get a free key at console.groq.com. This is the primary AI provider.
Groq’s free tier gives you 30 requests/min and up to 800 tokens/sec — plenty for development.

Setup

1

Clone repositories

git clone https://github.com/HarshBhanushali07/DualMind_Back.git
git clone https://github.com/HarshBhanushali07/DualMind_UI.git
git clone https://github.com/HarshBhanushali07/DualMind_Admin-UI.git
2

Configure environment variables

Create .env in DualMind_Back/src/DualMind.API/:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=eyJ...your-service-role-key
SUPABASE_KEY=eyJ...your-anon-key
JWT_SECRET=your-jwt-secret-from-supabase
GROQ_API_KEY=gsk_...your-groq-api-key
Never commit .env files to Git. The .gitignore already excludes them.
3

Start the backend

cd DualMind_Back/src/DualMind.API
dotnet restore
dotnet run
Verify: curl http://localhost:5079/health returns {"status":"healthy"}
4

Start the frontend

cd DualMind_UI
npm install
npm run dev
Verify: Open http://localhost:8000 in your browser
5

Your first arena battle

  1. Open http://localhost:8000
  2. Click Login with Google (or create an account via Supabase)
  3. Type a prompt like “Explain quantum computing simply”
  4. Click Compare — two models respond side-by-side
  5. Vote for the better response
  6. Model names are revealed after voting
You now have a running DualMind Lab instance with chat, comparisons, and voting.

Next steps

Architecture Overview

Understand the full system design

API Reference

Explore all API endpoints

Database Schema

See all tables and relationships

Troubleshooting

Fix common setup issues

Common issues

Root cause: JWT token is missing, expired, or signed with wrong secret.Fix:
  1. Verify JWT token is from Supabase Auth (not expired)
  2. Check Authorization: Bearer <token> header format
  3. Ensure JWT_SECRET in .env matches your Supabase project
# Paste your token at jwt.io to inspect claims
# Verify: iss matches SUPABASE_URL/auth/v1, aud is "authenticated"
Root cause: AI provider failure or missing database records.Fix:
  1. Check GROQ_API_KEY is valid at console.groq.com
  2. Ensure ai_models table has at least one row with status = 'active'
  3. Check backend terminal logs for the specific provider error
The fallback chain tries: Groq primary → Groq alt model → Bytez. All three must fail for a 500.
Root cause: Backend not running or CORS misconfiguration.Fix:
  1. Verify backend is running: curl http://localhost:5079/health
  2. Check config.jsapiBaseUrl auto-detects localhost in development
  3. Open browser DevTools > Console for specific CORS or network errors
In production, the Cloudflare Worker proxies /api/* to the backend, so CORS is not an issue.