Deploy to Vercel
Deploy your WhatsApp WAHA Dashboard to Vercel for a fast, scalable frontend hosting solution.Prerequisites
- GitHub account with your code repository
- Vercel account (free tier available)
- MongoDB database (MongoDB Atlas recommended)
- WAHA (WhatsApp HTTP API) server running
- Mailgun account for email functionality
Deployment Steps
1. Prepare Your Repository
Ensure your code is pushed to GitHub:2. Import to Vercel
- Visit vercel.com and sign in
- Click “Add New Project”
- Import your GitHub repository
- Select the
whatsapp-group-managerrepository
3. Configure Build Settings
Vercel should auto-detect Next.js. Verify these settings:- Framework Preset: Next.js
- Build Command:
pnpm build - Output Directory:
.next - Install Command:
pnpm install
4. Add Environment Variables
In the Vercel dashboard, add all required environment variables. See Environment Variables for complete reference.5. Deploy
- Click “Deploy”
-
Vercel will automatically:
- Install dependencies with pnpm
- Push Prisma schema to MongoDB
- Generate Prisma client
- Build the Next.js application
- Deploy to production
-
Your app will be available at
https://your-app.vercel.app
Post-Deployment Steps
Update Better Auth URL
After first deployment, update theBETTER_AUTH_URL environment variable:
- Go to Project Settings → Environment Variables
- Update
BETTER_AUTH_URLto your actual Vercel URL - Redeploy the application
Set Up Custom Domain (Optional)
- Go to Project Settings → Domains
- Add your custom domain
- Configure DNS settings as instructed
- Update
BETTER_AUTH_URLto your custom domain
Verify Deployment
Deployment Configuration Options
Build Optimization
Thepackage.json build script includes automatic database setup:
- Database schema is always up-to-date
- Prisma client is generated before build
- Seamless deployments on every push
Automatic Deployments
Vercel automatically deploys:- Production: Every push to
mainbranch - Preview: Every pull request
- Go to Project Settings → Git
- Configure deployment branches
Troubleshooting
Build Failures
Database connection issues:- Ensure
prismais in devDependencies - Check that
postinstallscript runsprisma generate
Runtime Errors
Authentication not working:- Verify
BETTER_AUTH_SECRETis set - Confirm
BETTER_AUTH_URLmatches your domain - Check all auth-related environment variables
- Verify Mailgun credentials
- Check
FROM_EMAILdomain matchesMAILGUN_DOMAIN - Review Vercel function logs
Next Steps
Scheduler Setup
Set up the message scheduler on a VPS
Environment Variables
Complete environment variable reference
Monitoring
Monitor your Vercel deployment:- Analytics: Track page views and performance
- Logs: View real-time function logs
- Insights: Monitor Web Vitals and performance metrics
- Deployments: Track deployment history and rollback if needed