Overview
Vercel offers the fastest deployment path for Kuest Prediction Market with one-click Supabase integration. This guide covers the complete deployment process including environment configuration, database setup, and domain management.Vercel deployment is the recommended approach for most users. It includes automatic Supabase integration, serverless functions, and built-in cron jobs.
Prerequisites
Before deploying to Vercel, ensure you have:- GitHub account
- Vercel account (free tier available)
- Kuest CLOB Auth credentials from auth.kuest.com
- Reown AppKit Project ID from dashboard.reown.com
Deployment Steps
Changing
BETTER_AUTH_SECRET after deployment will invalidate all user sessions and encrypted credentials, requiring users to log in and re-authenticate for trading..env.example filePOSTGRES_URL - Database connection stringSUPABASE_URL - Supabase project URLSUPABASE_SERVICE_ROLE_KEY - Service role key for storageSupabase integration includes:
- PostgreSQL database (500MB free tier)
- Object storage bucket (
kuest-assets) - Automatic cron job scheduling via Supabase Edge Functions
markets.example.com)After adding a custom domain, update
SITE_URL in your environment variables to match your production domain, then redeploy.Environment Variables Reference
Required Variables
| Variable | Description | Example |
|---|---|---|
KUEST_ADDRESS | Your Kuest wallet address on Polygon | 0x1234... |
KUEST_API_KEY | API key from auth.kuest.com | - |
KUEST_API_SECRET | API secret from auth.kuest.com | - |
KUEST_PASSPHRASE | API passphrase from auth.kuest.com | - |
ADMIN_WALLETS | Comma-separated admin addresses | 0x123...,0x456... |
REOWN_APPKIT_PROJECT_ID | Reown project ID | - |
BETTER_AUTH_SECRET | 32-character random string | - |
CRON_SECRET | 16+ character random string | - |
Auto-Configured by Vercel
These are automatically set when you connect Supabase:| Variable | Description |
|---|---|
POSTGRES_URL | PostgreSQL connection string |
SUPABASE_URL | Supabase project URL |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key |
Optional Variables
| Variable | Description | Default |
|---|---|---|
IMAGE_OPTIMIZATION | Enable Next.js image optimization | false |
SENTRY_DSN | Sentry error tracking DSN | - |
SENTRY_ORG | Sentry organization | - |
SENTRY_PROJECT | Sentry project name | - |
SENTRY_AUTH_TOKEN | Sentry auth token | - |
Vercel-Specific Features
Automatic Cron Jobs
When using Supabase mode on Vercel, cron jobs are automatically configured viavercel.json:
Serverless Functions
All API routes automatically deploy as serverless functions with:- 10-second execution timeout (Hobby)
- 60-second execution timeout (Pro)
- Automatic scaling
- Edge network distribution
Build Configuration
Vercel automatically detects the Next.js framework and uses optimal settings:Troubleshooting
Deployment Failed
- Check build logs in Vercel dashboard
- Verify all required environment variables are set
- Ensure
BETTER_AUTH_SECRETis exactly 32 characters - Check for syntax errors in
.envfile
Database Connection Issues
- Verify Supabase integration is connected in Vercel Storage
- Check
POSTGRES_URLformat in environment variables - Redeploy after connecting Supabase
- Check Supabase dashboard for database status
Cron Jobs Not Running
- Verify
CRON_SECRETis set in environment variables - Check Vercel deployment logs for cron execution
- Ensure Supabase mode is properly configured
- Verify cron endpoints are accessible
Custom Domain SSL Issues
- Wait 24 hours for DNS propagation
- Verify DNS records match Vercel requirements
- Check domain provider for DNSSEC conflicts
- Remove and re-add domain in Vercel settings
Maintenance
Updating Your Deployment
To deploy updates from upstream:- Sync your fork with the upstream repository
- Vercel automatically deploys on git push to main branch
- Monitor deployment in Vercel dashboard
- Verify changes in production
Database Migrations
Database schema updates are handled automatically through:- Build-time migration scripts
- Supabase migration tracking
- Zero-downtime deployment strategy
Monitoring
Monitor your deployment through:- Vercel Analytics: Usage, performance, Core Web Vitals
- Supabase Dashboard: Database queries, storage usage
- Vercel Logs: Function execution, errors
- Sentry (optional): Error tracking and performance monitoring
Scaling Considerations
Free Tier Limits
- 100GB bandwidth per month
- 100 serverless function invocations per day
- 500MB PostgreSQL storage (Supabase free tier)
- 1GB file storage (Supabase free tier)
Upgrading to Pro
Consider upgrading when you need:- Custom domains on team projects
- Longer function timeouts (60s)
- Advanced analytics
- Priority support
- Password protection
- More team members
Next Steps
- Configure Docker deployment for self-hosting
- Set up Kubernetes for enterprise scale
- Explore cloud providers for alternative hosting