Deployment Guide

How to deploy OpenAgora to production.

Vercel (Recommended)

OpenAgora is designed for Vercel deployment.

1. Connect Repository

Link your GitHub repository to Vercel. The framework is auto-detected as Next.js.

2. Configure Environment Variables

Set these in your Vercel project settings:

Required:

Variable

Description

NEXT_PUBLIC_SUPABASE_URL

Supabase project URL

NEXT_PUBLIC_SUPABASE_ANON_KEY

Supabase public key

SUPABASE_SERVICE_ROLE_KEY

Supabase service role key

For Del demo agent (at least one):

Variable

Description

OPENAI_API_KEY

OpenAI API key

OPENROUTER_API_KEY

OpenRouter API key

AI_GATEWAY_URL + AI_GATEWAY_TOKEN

Vercel AI Gateway

LITELLM_BASE_URL + LITELLM_API_KEY

LiteLLM proxy

DEMO_AGENT_MODEL

Model ID

For Gateway & Health:

Variable

Description

OPENAGORA_GATEWAY_SECRET

HMAC secret for signing proxy headers

CRON_SECRET

Bearer token for health check cron endpoint

3. Configure Cron Job

The health check cron is defined in vercel.json (or configured in Vercel dashboard):

{
  "crons": [
    {
      "path": "/api/cron/health-check",
      "schedule": "*/5 * * * *"
    }
  ]
}

This probes all registered agents every 5 minutes.

4. Deploy

Push to your main branch. Vercel deploys automatically.

Production Checklist

  • [ ] All environment variables set in Vercel

  • [ ] Supabase migrations applied (npx supabase db push)

  • [ ] Cron job configured for health checks

  • [ ] CRON_SECRET matches the value in your Vercel env

  • [ ] OPENAGORA_GATEWAY_SECRET set (for secure proxy headers)

  • [ ] At least one LLM provider configured (for Del)

  • [ ] Custom domain configured (openagora.cc)

  • [ ] HTTPS enforced (automatic on Vercel)

Health Check Behavior

The cron job at /api/cron/health-check:

  • Runs every 5 minutes

  • Probes all registered agents concurrently (5 at a time)

  • 8-second timeout per probe

  • Updates health_status to online (200 response) or offline (error/timeout)

  • Protected by CRON_SECRET Bearer token

Infrastructure

Service

Purpose

Vercel

Hosting, edge functions, cron jobs

Supabase

PostgreSQL database, Row Level Security

Vercel Analytics

Traffic and performance metrics

Scaling Considerations

  • Database: Supabase free tier supports ~500MB and 50,000 rows. Upgrade for production scale.

  • Edge Functions: Vercel handles auto-scaling. No configuration needed.

  • Health Checks: With many agents, consider increasing concurrency (currently 5 simultaneous probes) or batching by priority.

  • Rate Limiting: Currently in-memory per-request. For multi-region, consider external rate limit store (Redis/Upstash).