One-Click Deployment
Click the button below to deploy Openfront to Vercel:- Clone the Openfront repository to your GitHub account
- Create a new Vercel project
- Provision a managed PostgreSQL database
- Deploy your Openfront instance
Deployment Process
Add PostgreSQL Database
Vercel will prompt you to add a PostgreSQL database. Click “Add” to provision a managed database
Environment Variables
Required Variables
Vercel will automatically configureDATABASE_URL when you add the PostgreSQL integration. You must manually set:
SESSION_SECRET
- Go to your project settings
- Navigate to “Environment Variables”
- Add
SESSION_SECRETwith your generated value - Save and redeploy
Optional Variables
Add these variables for additional functionality:Payment Providers
Stripe:Shipping Provider
File Storage (S3)
Without S3 configuration, Openfront will use local file storage. This works for development but is not recommended for production on Vercel as the filesystem is ephemeral.
Email Configuration
Database Configuration
Managed PostgreSQL
Vercel’s PostgreSQL integration automatically:- Provisions a managed database
- Sets the
DATABASE_URLenvironment variable - Handles connection pooling
- Provides automatic backups
External Database
You can also use an external PostgreSQL database:- Remove the Vercel PostgreSQL integration
- Add
DATABASE_URLenvironment variable with your database connection string:
Database Migrations
Vercel runs database migrations automatically during the build process. The build command includes:Build Configuration
Build Settings
Vercel automatically detects the build settings frompackage.json:
- Build Command:
npm run build - Output Directory:
.next - Install Command:
npm install - Development Command:
npm run dev
Node.js Version
Openfront requires Node.js 20 or higher. Vercel will automatically use Node.js 20+ based on theengines field in package.json:
Build Time
Expect build times of 3-5 minutes:- KeystoneJS schema generation: 30-60 seconds
- Database migrations: 30-90 seconds
- Next.js build: 2-3 minutes
Vercel-Specific Features
Automatic Deployments
Vercel automatically deploys:- Production: Pushes to
mainbranch - Preview: Pull requests and other branches
Environment-Specific Variables
Configure different variables for:- Production: Live store with real payment credentials
- Preview: Test store with sandbox credentials
- Development: Local development settings
Analytics and Monitoring
Vercel provides:- Real-time analytics
- Performance monitoring
- Error tracking
- Custom domains and SSL
Custom Domain Setup
Post-Deployment Setup
Webhook Configuration
Stripe Webhooks
- Go to Stripe Dashboard > Developers > Webhooks
- Add endpoint:
https://your-domain.vercel.app/api/webhooks/stripe - Select events to listen for:
payment_intent.succeededpayment_intent.payment_failedcharge.refunded
- Copy the webhook signing secret
- Add to Vercel environment variables as
STRIPE_WEBHOOK_SECRET
PayPal Webhooks
- Go to PayPal Developer Dashboard > Webhooks
- Add webhook:
https://your-domain.vercel.app/api/webhooks/paypal - Select event types:
PAYMENT.CAPTURE.COMPLETEDPAYMENT.CAPTURE.DENIED
Troubleshooting
Build Failures
Database connection errors:- Check
DATABASE_URLis correctly set - Ensure database is accessible from Vercel
- Check database credentials are correct
- Check database schema is compatible
- Review migration logs in Vercel dashboard
- Try running migrations manually
Runtime Issues
500 Internal Server Error:- Check Vercel function logs for errors
- Verify all required environment variables are set
- Check database connection
- Verify
SESSION_SECRETis at least 32 characters - Check database session storage is working
- Configure S3 storage for production
- Verify S3 credentials are correct
Performance Issues
Slow response times:- Check database performance and connection pooling
- Review Vercel function execution logs
- Consider upgrading Vercel plan for better resources
- Use connection pooling
- Upgrade database plan if needed
- Reduce concurrent connections
Scaling on Vercel
Horizontal Scaling
Vercel automatically scales your deployment:- Serverless functions scale automatically
- No configuration needed
- Pay only for what you use
Database Scaling
For high traffic:- Upgrade Vercel Postgres plan
- Use external managed database (e.g., Railway, Supabase)
- Enable read replicas
File Storage
Cost Considerations
Vercel Pricing
- Hobby Plan: Free for personal projects
- Pro Plan: $20/month for commercial use
- Enterprise: Custom pricing
Database Pricing
Vercel Postgres pricing:- Additional cost based on storage and compute
- Consider external database for cost optimization