Skip to main content
CharleOS is hosted on Vercel, which provides seamless deployment for Next.js applications. This page covers Vercel-specific configuration.

Vercel Setup

Project Configuration

Team: Charle Agency
Project: charle-os
Framework: Next.js 16
Build Command: npm run build
Output Directory: .next

Git Integration

Vercel is connected to the GitHub repository: Repository: charle/charle-os
Production Branch: main
Deploy Previews: All branches
Automatic deployments:
  • ✅ Push to main → Production deployment
  • ✅ Open PR → Preview deployment
  • ✅ Update PR → Preview update
  • ✅ Merge PR → Production deployment

Environment Variables

Setting Environment Variables

  1. Go to Vercel Dashboard
  2. Settings → Environment Variables
  3. Add variable:
    • Name: DATABASE_URL
    • Value: postgresql://...
    • Environments: Production, Preview, Development
  4. Click “Save”

Environment Scopes

Variables can be scoped to specific environments:
Never use production credentials in preview deployments. Always use separate DEV database and test API keys.

Required Variables

Core

Integrations

Deployment Configuration

Build Settings

Regions

CharleOS is deployed to:
  • Primary: London (lhr1) - Closest to users
  • Edge: Global CDN for static assets

Build Output

After successful build:
  • .next/ - Built application
  • public/ - Static assets
  • drizzle/ - Migrations (applied during build)

Deployment Workflow

Production Deployment

Deployment time: ~2-3 minutes

Preview Deployment

Preview features:
  • Unique URL per branch
  • Shareable for testing
  • Auto-deleted after PR merge
  • Comments added to PR with preview URL

Vercel Features

Analytics

Built-in analytics show:
  • Web Vitals: LCP, FID, CLS, TTFB
  • Top Pages: Most visited pages
  • Top Referrers: Traffic sources
  • Real User Monitoring: Actual user experience
Access: Dashboard → Analytics

Logs

Real-time logs for debugging: Build Logs:
  • Dependency installation
  • Database migration output
  • Build errors/warnings
Runtime Logs:
  • API route requests
  • Server component logs
  • Error stack traces
Edge Logs:
  • Edge function execution
  • Regional performance
Access: Dashboard → Deployments → Select deployment → Logs

Speed Insights

Track performance metrics:
  • Real User Monitoring (RUM)
  • Core Web Vitals breakdown
  • Page-by-page performance
  • Regional performance data

Monitoring

Uptime and performance monitoring:
  • 99.99% uptime SLA
  • Automated health checks
  • Incident notifications
  • Status page

Custom Domains

CharleOS uses custom domains:

Main App

Domain: charle.agency
DNS: Managed by Cloudflare
SSL: Automatic (Vercel)
DNS Configuration:

Client Portal

Domain: clients.charle.agency
Subdomain: Separate Next.js app deployment
DNS Configuration:

Performance Optimization

Caching

Vercel automatically caches: Static Assets:
Server Components:
API Routes:

Image Optimization

Next.js Image component uses Vercel’s optimizer:
Optimizations:
  • Automatic WebP/AVIF conversion
  • Responsive sizing
  • Lazy loading
  • CDN caching

Edge Functions

API routes run on Vercel Edge (close to users):

Security

HTTPS/SSL

  • Automatic SSL certificate provisioning
  • TLS 1.3 encryption
  • HTTP → HTTPS redirect
  • HSTS enabled

DDoS Protection

Vercel provides:
  • Edge network DDoS mitigation
  • Automatic rate limiting
  • IP blocking for abuse

Security Headers

Vercel CLI

Installation

Common Commands

Troubleshooting

Build Failures

Error: “Command ‘npm run build’ exited with 1” Fix:
  1. Check build logs in Vercel dashboard
  2. Run npm run build locally
  3. Fix TypeScript errors
  4. Check environment variables are set
  5. Verify migrations don’t have errors

Deployment Timeout

Error: “Build exceeded maximum duration” Fix:
  • Optimize build (remove unnecessary dependencies)
  • Enable build cache
  • Contact Vercel support for timeout increase

Environment Variable Not Found

Error: “Missing environment variable: X” Fix:
  1. Go to Vercel Dashboard → Settings → Environment Variables
  2. Add missing variable
  3. Select correct environments (Production/Preview)
  4. Redeploy

Domain Not Resolving

Error: “ERR_NAME_NOT_RESOLVED” Fix:
  1. Check DNS configuration in Cloudflare
  2. Verify CNAME points to cname.vercel-dns.com
  3. Wait for DNS propagation (up to 48 hours)
  4. Use dig charle.agency to check DNS

Best Practices

Always test in preview before merging:
  1. Open PR
  2. Wait for preview deployment
  3. Test preview URL thoroughly
  4. Merge to main when confirmed working
Use different credentials for preview:
  • Production: Real database, real API keys
  • Preview: DEV database, test API keys
  • Never mix environments
Check Vercel Analytics after deploying:
  • Verify traffic is flowing
  • Check for errors in logs
  • Monitor Core Web Vitals
Optimize build time:
  • Remove unused dependencies
  • Enable build caching
  • Minimize dynamic imports

Deployment Overview

General deployment process

CI/CD

Automated testing pipeline

Environment Variables

All environment variables

Vercel Docs

Official Vercel documentation