Build & Deployment
Vercel Setup
Project Settings
- Project Name: agentbot
- Root Directory:
web - Framework: Next.js (auto-detected)
Environment Variables
Required for production:| Variable | Description |
|---|---|
DATABASE_URL | Neon PostgreSQL connection string |
NEXTAUTH_SECRET | Auth secret (generate with openssl rand -base64 32) |
NEXTAUTH_URL | Production URL (https://agentbot.raveculture.xyz) |
STRIPE_SECRET_KEY | Stripe secret key |
ADMIN_EMAILS | Comma-separated admin emails |
| Variable | Description |
|---|---|
REDIS_URL | Upstash Redis for rate limiting |
RESEND_API_KEY | For welcome emails |
DISCORD_WEBHOOK_URL | For notifications |
TELEGRAM_BOT_TOKEN | For Telegram bot |
Build Commands
Deployment
Automatic (Git Push)
Push to main branch triggers Vercel deployment automatically.Manual
Build Stability
Pre-build Validation
The build includes:- Prisma client generation
- TypeScript compilation
- Next.js static generation
Common Issues
| Issue | Solution |
|---|---|
| Module resolution errors | Check tsconfig.json path mappings |
| Prisma errors | Run npx prisma generate |
| Environment errors | Verify all required env vars set |
Rollback
Vercel automatically keeps deployment history. To rollback:- Go to Vercel Dashboard
- Find previous working deployment
- Click ”…” → “Promote to Production”