Prerequisites
- Vercel account
- GitHub repository with your ZeroStarter project
- PostgreSQL database (Vercel Postgres, Neon, or other provider)
Project Structure
ZeroStarter includes Vercel configuration files for both services:Configuration Files
Hono API Configuration
The API service uses this configuration (api/hono/vercel.json):
api/hono/vercel.json
The API is configured to use Bun runtime and Turborepo for optimal build performance.
Next.js Configuration
The web service uses this configuration (web/next/vercel.json):
web/next/vercel.json
Deployment Steps
Create Vercel Projects
Create two separate Vercel projects:
- API Project - Point to
api/honodirectory - Web Project - Point to
web/nextdirectory
Deploy API Service
In your Vercel dashboard:
- Create a new project
- Import your GitHub repository
- Set Root Directory to
api/hono - Vercel will auto-detect the
vercel.jsonconfiguration - Configure environment variables (see below)
- Deploy
https://api.yourproject.vercel.app)Environment Variables
API Service Environment Variables
Configure these in your API Vercel project:Web Service Environment Variables
Configure these in your Web Vercel project:Database Setup
Set up PostgreSQL
Choose a PostgreSQL provider:
- Vercel Postgres - Integrated with Vercel
- Neon - Serverless Postgres with free tier
- Supabase - Postgres with additional features
- Railway - Simple deployment platform
Custom Domains
Configure API domain
In your API Vercel project:
- Go to Settings > Domains
- Add your API domain (e.g.,
api.yourdomain.com) - Update
HONO_APP_URLenvironment variable - Redeploy
Continuous Deployment
Vercel automatically deploys when you push to your repository:- Production - Pushes to
mainbranch - Preview - Pull requests and other branches
Environment Variables per Branch
Configure different variables for preview deployments:- Go to project Settings > Environment Variables
- Select environment scope:
- Production
- Preview
- Development
Monorepo Build Configuration
Bothvercel.json files use Turborepo for efficient builds:
installCommand: Installs dependencies from monorepo rootbuildCommand: Uses Turbo filters to build only required packages--ignore-scripts: Skips postinstall scripts for faster builds
Troubleshooting
Build fails with 'turbo not found'
Build fails with 'turbo not found'
Ensure
turbo is listed in root package.json devDependencies:package.json
CORS errors in production
CORS errors in production
Verify Separate multiple origins with commas.
HONO_TRUSTED_ORIGINS includes your web URL:Environment variables not updating
Environment variables not updating
After changing environment variables:
- Go to Deployments
- Click ”…” on latest deployment
- Select “Redeploy”
- Check “Use existing Build Cache” is unchecked
Database connection fails
Database connection fails
Check your Ensure SSL is enabled if required by your provider.
POSTGRES_URL format:Performance Optimization
Edge Runtime
Hono API runs on Vercel’s Edge Runtime by default, providing:- Low latency worldwide
- Automatic scaling
- Pay-per-execution pricing
Next.js Configuration
Optimize your Next.js deployment:next.config.ts
Next Steps
Production Checklist
Complete the production readiness checklist
Analytics & Monitoring
Set up PostHog analytics and monitoring