Skip to main content
description: “Agentbot build process and deployment”

Build & Deployment

Vercel Setup

Project Settings

  • Project Name: agentbot
  • Root Directory: web
  • Framework: Next.js (auto-detected)

Environment Variables

Required for production:
VariableDescription
DATABASE_URLNeon PostgreSQL connection string
NEXTAUTH_SECRETAuth secret (generate with openssl rand -base64 32)
NEXTAUTH_URLProduction URL (https://agentbot.raveculture.xyz)
STRIPE_SECRET_KEYStripe secret key
ADMIN_EMAILSComma-separated admin emails
Optional but recommended:
VariableDescription
REDIS_URLUpstash Redis for rate limiting
RESEND_API_KEYFor welcome emails
DISCORD_WEBHOOK_URLFor notifications
TELEGRAM_BOT_TOKENFor Telegram bot

Build Commands

# Development
cd web && npm run dev

# Production build
cd web && npm run build

# Lint
cd web && npm run lint

Deployment

Automatic (Git Push)

Push to main branch triggers Vercel deployment automatically.

Manual

cd web
vercel --prod --yes

Build Stability

Pre-build Validation

The build includes:
  1. Prisma client generation
  2. TypeScript compilation
  3. Next.js static generation

Common Issues

IssueSolution
Module resolution errorsCheck tsconfig.json path mappings
Prisma errorsRun npx prisma generate
Environment errorsVerify all required env vars set

Rollback

Vercel automatically keeps deployment history. To rollback:
  1. Go to Vercel Dashboard
  2. Find previous working deployment
  3. Click ”…” → “Promote to Production”