Deployment Configuration
Thevercel.json file in the project root configures deployment behavior, security headers, caching policies, and rewrites.
Ignore Command
World Monitor uses an intelligent ignore command to skip deployments when only documentation or non-production files change:vercel.json
- Skips deployment if only Markdown files changed
- Ignores changes to
docs/,e2e/,scripts/, and.github/directories - Allows full deployment for code changes
Security Headers
Content Security Policy (CSP)
World Monitor implements a strict Content Security Policy that allows necessary external resources while maintaining security:vercel.json
- X-Content-Type-Options: Prevents MIME-type sniffing
- X-Frame-Options: Prevents clickjacking (SAMEORIGIN only)
- HSTS: Forces HTTPS with 2-year max age and preload
- Permissions-Policy: Blocks camera, microphone, and geolocation access
- CSP: Strict policy allowing only trusted sources
Caching Strategy
HTML Pages - No Cache
vercel.json
Static Assets - Immutable
vercel.json
Service Worker - Revalidate
vercel.json
Other Resources
- Favicons:
max-age=604800(7 days) - Manifest:
max-age=86400(1 day) - Offline page:
max-age=86400(1 day)
Rewrites
PostHog Analytics Proxy
Proxy PostHog requests through your domain to avoid ad blockers:vercel.json
/ingest/* requests to PostHog’s US servers while keeping them on your domain.
Build Configuration
# Tech variant
npm run build:tech
# Finance variant
npm run build:finance
# Happy variant
npm run build:happy
Environment Variables
Configure these environment variables in your Vercel project settings:Required
FRED_API_KEY- Federal Reserve Economic Data API keyCONVEX_DEPLOYMENT- Convex deployment URLCONVEX_DEPLOY_KEY- Convex deployment key
Optional
VITE_VARIANT- Set totech,finance, orhappyfor variant buildsSENTRY_DSN- Sentry error tracking DSNPOSTHOG_API_KEY- PostHog analytics key
Rate Limiting
UPSTASH_REDIS_REST_URL- Upstash Redis URL for rate limitingUPSTASH_REDIS_REST_TOKEN- Upstash Redis token
Vercel CLI Commands
Preview Deployment
Production Deployment
Environment Variables
Logs
Serverless Functions
World Monitor uses Vercel Serverless Functions in theapi/ directory:
api/[domain]/v1/[rpc].ts- Sebuf RPC gateway for data APIsapi/rss-proxy.js- RSS feed proxy with allowlistapi/fred-data.js- Federal Reserve economic data proxy
API Routes
All API routes are automatically deployed as serverless functions:Performance Optimization
Brotli Compression
World Monitor pre-compresses assets with Brotli during build:vite.config.ts
Code Splitting
Large dependencies are split into separate chunks:vite.config.ts
Multi-Variant Deployment
Deploy different variants to separate Vercel projects:- Uses different branding and metadata
- Loads variant-specific datasets
- Applies custom theme colors
- Serves from dedicated domains
Monitoring
Vercel Analytics
World Monitor integrates with Vercel Analytics:Sentry Error Tracking
Troubleshooting
Build Failures
If the build fails:- Check TypeScript errors:
npm run typecheck:all - Verify environment variables are set
- Clear Vercel cache:
vercel build --force
Function Timeouts
Serverless functions have a 10-second timeout on Hobby plan, 60 seconds on Pro:- Optimize API calls with caching
- Use edge functions for faster cold starts
- Consider upgrading to Pro for longer timeouts
Large Bundle Size
If bundle size exceeds limits:- Review chunk sizes:
npm run buildshows warnings - Lazy-load large dependencies
- Exclude heavy ML models from main bundle
CSP Violations
If resources are blocked by CSP:- Check browser console for CSP violations
- Add trusted domains to
vercel.jsonCSP header - Test locally with production build:
npm run preview