Skip to content

Repository files navigation

OpenBrain — Vercel Deployment Guide

OpenBrain is a multi-engine AI chat platform supporting GPT-4o, Claude 3.5, Gemini 2.0, and Perplexity — all through a single interface with Midnight Glass dark aesthetic.


Prerequisites


Step 1 — Set up the Database (Neon)

  1. Create a free database at neon.tech
  2. Copy the connection string (it looks like postgresql://...)
  3. You'll use it as DATABASE_URL in Step 4

Step 2 — Set up Clerk Authentication

  1. Create an app at dashboard.clerk.com
  2. Go to API Keys and copy:
    • Publishable keyVITE_CLERK_PUBLISHABLE_KEY and CLERK_PUBLISHABLE_KEY
    • Secret keyCLERK_SECRET_KEY
  3. In Clerk dashboard → Domains, add your Vercel deployment URL

Step 3 — Get OpenRouter API Key

  1. Go to openrouter.ai/keys
  2. Create a new key and copy it → OPENROUTER_API_KEY

Step 4 — Deploy to Vercel

Option A: Via Vercel CLI (recommended)

# Install Vercel CLI
npm install -g vercel

# Deploy from this folder
cd vercel-deploy
npm install
vercel

# Set environment variables
vercel env add CLERK_SECRET_KEY
vercel env add CLERK_PUBLISHABLE_KEY
vercel env add VITE_CLERK_PUBLISHABLE_KEY
vercel env add OPENROUTER_API_KEY
vercel env add DATABASE_URL

# Deploy to production
vercel --prod

Option B: Via GitHub + Vercel Dashboard

  1. Push this vercel-deploy/ folder contents to a new GitHub repository
  2. Go to vercel.com/new and import the repo
  3. In Environment Variables, add all 5 variables from .env.example
  4. Click Deploy

Step 5 — Initialize the Database

After deploying, run the database migration once:

DATABASE_URL="your-connection-string" npm run db:push

Or in Vercel dashboard → Functions → run:

npx drizzle-kit push

Environment Variables Summary

Variable Description
CLERK_SECRET_KEY Clerk secret key (sk_live_...)
CLERK_PUBLISHABLE_KEY Clerk publishable key (pk_live_...)
VITE_CLERK_PUBLISHABLE_KEY Same as CLERK_PUBLISHABLE_KEY (for Vite build)
OPENROUTER_API_KEY OpenRouter API key (sk-or-v1-...)
DATABASE_URL PostgreSQL connection string

Tech Stack

  • Frontend: React 18, Vite, Tailwind CSS v4, Framer Motion
  • Backend: Express.js as Vercel Serverless Function
  • Auth: Clerk (OpenID Connect)
  • Database: PostgreSQL via Drizzle ORM + Neon serverless driver
  • AI: OpenRouter API (GPT-4o, Claude 3.5, Gemini 2.0, Perplexity)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages