Skip to content

Vercel Deployment

Deploy the LenserFight web app to Vercel for automatic builds, global CDN, and serverless functions.

Prerequisites

  • A Vercel account (vercel.com)
  • The repository pushed to GitHub, GitLab, or Bitbucket
  • A Supabase project (hosted or self-managed)

Step 1 — Import the project

  1. Log in to Vercel
  2. Click New Project
  3. Import your LenserFight repository
  4. Configure build settings:
SettingValue
Framework PresetVite
Build Commandpnpm nx run web:build
Output Directorydist/apps/web
Install Commandpnpm install --frozen-lockfile
Root Directory. (repository root)

Step 2 — Environment variables

Add to Vercel project settings (Settings → Environment Variables):

VariableValue
DATA_SOURCEsupabase
SUPABASE_URLYour Supabase project URL
SUPABASE_ANON_KEYYour Supabase anon key
WEB_BASE_URLYour Vercel domain

Step 3 — Configure Vercel

Create vercel.json in the repository root:

json
{
  "buildCommand": "pnpm nx run web:build",
  "outputDirectory": "dist/apps/web",
  "installCommand": "pnpm install --frozen-lockfile",
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ],
  "headers": [
    {
      "source": "/assets/(.*)",
      "headers": [
        { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }
      ]
    }
  ]
}

Step 4 — Deploy

bash
# Via CLI
npx vercel --prod

# Or push to your connected branch — Vercel auto-deploys
git push origin main

Custom domain

  1. Navigate to Settings → Domains
  2. Add your domain
  3. Configure DNS:
    • A record: 76.76.21.21
    • CNAME: cname.vercel-dns.com

Vercel automatically provisions SSL.


Limitations

AspectNotes
Server-side codeVercel runs static + serverless only
Platform APIMust be deployed separately (VPS, Railway, etc.)
WebSocketRequires separate WebSocket server
File uploadsGo through Supabase Storage, not Vercel

Next steps