Deployment
Kaizen OS Portal Deployment Guide¶
This guide covers deploying the Kaizen OS Portal frontend to production.
Quick Deploy (Vercel - Recommended)¶
1. Prerequisites¶
- Vercel account
- GitHub repository access
- Backend API running
2. Deploy Steps¶
- Connect Repository
- Go to Vercel Dashboard
- Click "New Project"
- Import your GitHub repository
-
Select the
apps/portaldirectory as the root -
Configure Environment Variables
-
Deploy
- Click "Deploy"
- Vercel will automatically build and deploy
-
Your portal will be available at
https://your-project.vercel.app -
Custom Domain (Optional)
- Go to Project Settings → Domains
- Add your custom domain (e.g.,
kaizen.os) - Configure DNS records as instructed
Alternative Deployment Options¶
Render (Static Web Service)¶
- Create New Service
- Go to Render Dashboard
-
Click "New" → "Static Site"
-
Configure Service
- Connect your GitHub repository
- Build Command:
cd apps/portal && npm install && npm run build - Publish Directory:
apps/portal/out -
Node Version: 20
-
Set Environment Variables
- Same as Vercel configuration above
Self-Hosted (Docker)¶
-
Create Dockerfile
-
Build and Run
Pre-Deployment Checklist¶
Backend Requirements¶
- API Gateway running and accessible
- CORS configured for portal origin
- All required endpoints implemented:
-
GET /v1/status -
GET /v1/companions -
GET /v1/gi/me -
POST /v1/onboard/apply -
POST /v1/reflections -
GET /v1/reflections/me -
POST /v1/domains/preview -
POST /v1/domains/seal
Frontend Testing¶
- All pages load without errors
- Health badge shows correct status
- Onboarding flow works end-to-end
- Dashboard displays data correctly
- Responsive design works on mobile
Security¶
- Environment variables properly configured
- No sensitive data in client-side code
- HTTPS enabled in production
- CORS properly configured
Post-Deployment¶
1. Smoke Testing¶
# Test health endpoint
curl -sSf https://api.kaizen.os/v1/status | jq
# Test companions
curl -sSf https://api.kaizen.os/v1/companions | jq
# Test portal loads
curl -sSf https://kaizen.os | grep -q "Kaizen OS"
2. Monitoring Setup¶
- Set up uptime monitoring (UptimeRobot, Pingdom)
- Configure error tracking (Sentry, Bugsnag)
- Set up analytics (Plausible, PostHog)
3. Performance Optimization¶
- Enable CDN caching
- Optimize images and assets
- Monitor Core Web Vitals
Troubleshooting¶
Common Issues¶
Build Failures - Check Node.js version (requires 20+) - Verify all dependencies installed - Check for TypeScript errors
Runtime Errors - Verify environment variables set correctly - Check API endpoints are accessible - Review browser console for errors
CORS Issues - Ensure backend allows portal origin - Check preflight requests handled - Verify headers configured correctly
Support¶
- Check GitHub Issues for known problems
- Join Discord for community support
- Contact team for critical issues
Rollback Plan¶
If issues arise after deployment:
- Vercel: Use deployment history to rollback
- Render: Use previous deployment
- Self-hosted: Revert to previous Docker image
Always test rollback procedures before going live!