Deployment
Guide for deploying ShipKit to production
Deployment Guide
This guide covers the deployment process for ShipKit using Vercel.
Quick Start
Deploy ShipKit to Vercel with one click:
Runtime Support
ShipKit supports:
- Node.js (16.x, 18.x, 20.x)
- Bun
- Deno (via Node compatibility mode)
Package Manager Support
Use your preferred package manager:
Prerequisites
Before deploying, ensure you have:
- A Vercel account
- Access to all required services:
Environment Variables
Set up the following environment variables in your Vercel project:
Vercel Configuration
The project includes a vercel.json
configuration file with the following settings:
- Build Command:
pnpm run build
- Development Command:
pnpm run dev
- Install Command:
pnpm install
- Framework: Next.js
- Region: iad1 (US East)
- Git Deployment: Enabled for main branch only
- Cron Jobs: Daily cleanup at midnight
- Function Configuration: 1GB memory, 10s timeout
- Security Headers: XSS protection, content type options, frame options
Deployment Process
1. Automated Deployment
- Click the "Deploy to Vercel" button above
- Choose your repository name
- Deploy without any environment variables initially
- Follow the post-deployment setup wizard
2. Manual Deployment
If you prefer to deploy manually:
3. Post-Deployment Setup
The setup wizard will guide you through configuring:
-
Database
- Set up PostgreSQL on Neon or Supabase
- Configure connection string
- Run initial migrations
-
Authentication
- Set up OAuth providers
- Configure callback URLs
- Set authentication secrets
-
Payment & Licensing
- Connect LemonSqueezy
- Configure webhooks
- Set up API access
-
Content Management
- Configure Payload CMS
- Set up Builder.io (optional)
-
Email
- Set up Resend
- Configure email templates
- Test email delivery
Production Optimizations
The project includes several production optimizations:
-
Next.js Configuration:
- Remote image patterns configured for various services
- MDX support enabled
- Server actions size limit set
- Next Script Workers enabled
-
Security:
- Strict CSP headers
- XSS protection
- Frame options set to DENY
- Content type options set to nosniff
-
Performance:
- Automatic image optimization
- Edge functions in US East region
- Memory limits set for API routes
Monitoring and Maintenance
-
Logs: Monitor application logs in Vercel's dashboard
-
Cron Jobs: The
/api/cron/cleanup
endpoint runs daily at midnight -
Database: Ensure regular backups of your production database
-
Error Tracking: Set up error tracking through Vercel's integration with your preferred service
Troubleshooting
Common deployment issues and solutions:
-
Build Failures:
- Check build logs in Vercel
- Verify all environment variables are set
- Ensure dependencies are correctly installed
-
Runtime Errors:
- Monitor server logs
- Check database connectivity
- Verify third-party service credentials
-
Performance Issues:
- Monitor Edge Function execution times
- Check database query performance
- Review API route response times
-
Runtime-Specific Issues:
- Node.js: Ensure you're using version 16.x or later
- Bun: Check Bun version is 1.0 or later
- Deno: Enable Node.js compatibility mode
Best Practices
-
Testing:
- Always test in a staging environment first
- Use environment variables for staging configuration
- Run full test suite before deploying
-
Security:
- Regularly rotate secrets and API keys
- Monitor for suspicious activity
- Keep dependencies updated
-
Maintenance:
- Schedule regular database maintenance
- Monitor disk usage and performance
- Keep Next.js and dependencies updated
Need Help?
- Join our GitHub Discussions
- Follow us on Twitter
- Email us at [email protected]
- Visit our website