Skip to Content
🚀 Alpha Release - Yama JS is currently in alpha. APIs may change without notice.

Deploying to Vercel

Deploy your Yama application to Vercel for zero-config serverless deployment.

Prerequisites

  • A Vercel account (sign up )
  • Your Yama project ready for deployment

Quick Deploy

Option 1: Vercel CLI

# Install Vercel CLI npm i -g vercel # Deploy vercel

Option 2: GitHub Integration

  1. Push your code to GitHub
  2. Import your repository in Vercel
  3. Vercel will auto-detect and deploy

Configuration

Create a vercel.json file:

{ "buildCommand": "yama build", "outputDirectory": "dist", "installCommand": "pnpm install", "framework": null, "rewrites": [ { "source": "/(.*)", "destination": "/server.js" } ], "env": { "DATABASE_URL": "@database-url", "JWT_SECRET": "@jwt-secret" } }

Environment Variables

Set environment variables in Vercel dashboard:

  1. Go to your project settings
  2. Navigate to “Environment Variables”
  3. Add your variables:
    • DATABASE_URL
    • JWT_SECRET
    • NODE_ENV=production

Database Migrations

Run migrations before deployment:

# In your build command or pre-deploy hook yama schema:apply

Or use Vercel’s build hooks to run migrations automatically.

Serverless Functions

Yama automatically optimizes for serverless:

  • Each endpoint can be deployed as a separate function
  • Automatic cold start optimization
  • Pay-per-use pricing

Custom Domain

  1. Go to project settings
  2. Navigate to “Domains”
  3. Add your custom domain
  4. Configure DNS records

Monitoring

Monitor your deployment:

  • View logs in Vercel dashboard
  • Set up alerts for errors
  • Monitor function execution times

Troubleshooting

Build Errors

Check your build logs in Vercel dashboard. Common issues:

  • Missing environment variables
  • Database connection issues
  • Build command errors

Cold Starts

Serverless functions may have cold starts. Optimize by:

  • Using connection pooling
  • Keeping functions warm (Vercel Pro)
  • Optimizing handler code

Next Steps

Last updated on