This document provides a comprehensive checklist for deploying the HD Chart Generator application to production.
- Pre-Deployment Verification
- Railway Backend Deployment
- Vercel Frontend Deployment
- Post-Deployment Verification
- Rollback Procedures
- All unit tests pass (
pytest) - Backend health endpoint responds correctly
- All required environment variables are set
- Database migrations are up to date
- No hardcoded secrets in code
- Dependencies are locked (
requirements.txtupdated) - CORS configuration includes production frontend URL
- Swiss Ephemeris data files are included
- Logging is configured for production
- Error handling covers all edge cases
- Production build completes without errors (
npm run build) - No TypeScript errors
- No ESLint errors
- Bundle size is acceptable (< 500KB for main chunk)
- Environment variables configured for production
- API endpoints point to production backend
- No console.log statements in production code
- All images optimized
- Meta tags and SEO configured
- Analytics configured (if applicable)
- End-to-end user flow tested locally
- Chart generation tested with multiple scenarios
- Email capture tested and verified
- Error scenarios handled gracefully
- Performance metrics meet targets (< 2s chart generation)
- No CORS errors in local testing
- Mobile responsiveness verified
- Browser compatibility tested (Chrome, Firefox, Safari)
# Install Railway CLI (if not already installed)
npm install -g @railway/cli
# Login to Railway
railway login
# Link to existing project or create new
railway linkSet the following environment variables in Railway dashboard:
Required Variables:
PORT=5000
HOST=0.0.0.0
FRONTEND_URL=https://your-frontend-domain.vercel.app
DATABASE_URL=<railway-provided-postgres-url>
DEBUG=false
Optional Variables:
HD_API_URL=https://api.humandesign.ai/v1
HD_API_KEY=<your-api-key-if-using>
In Railway dashboard:
- Root Directory:
/backend - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn src.main:app --host 0.0.0.0 --port $PORT - Python Version: 3.12
# From project root
cd backend
# Deploy to Railway
railway up
# Monitor deployment
railway logs# Test health endpoint
curl https://your-backend-domain.railway.app/health
# Expected response:
# {"status":"healthy","service":"hd-chart-generator"}# Connect to Railway database
railway run alembic upgrade head# Install Vercel CLI (if not already installed)
npm install -g vercel
# Login to Vercel
vercel login
# Link to existing project or create new
cd frontend
vercel linkSet in Vercel dashboard under Project Settings > Environment Variables:
Production Variables:
NEXT_PUBLIC_API_URL=https://your-backend-domain.railway.app
NODE_ENV=production
In Vercel dashboard:
- Framework Preset: Next.js
- Root Directory:
frontend - Build Command:
npm run build - Output Directory:
.next - Install Command:
npm install - Node Version: 20.x
# From frontend directory
cd frontend
# Deploy to production
vercel --prod
# Or push to main branch (if auto-deploy enabled)
git push origin mainIn Vercel dashboard:
- Go to Project Settings > Domains
- Add your custom domain
- Update DNS records as instructed
- Enable HTTPS (automatic)
After frontend is deployed, update backend environment variable:
FRONTEND_URL=https://your-actual-frontend-domain.vercel.app
Redeploy backend to apply CORS changes.
- Health endpoint responds:
GET /health - Chart generation works:
POST /api/hd-chart - Email capture works:
POST /api/email-capture - Error responses are properly formatted
- Logs are accessible in Railway dashboard
- Response times are acceptable (< 2s)
- Database connections are stable
- No memory leaks (monitor for 24 hours)
- Homepage loads correctly
- Form validation works
- Chart generation displays results
- Email capture shows success message
- Error messages display properly
- No console errors in browser
- Mobile view works correctly
- Images load properly
- SEO meta tags present
- Analytics tracking works (if applicable)
- End-to-end user flow works
- No CORS errors
- Network requests succeed (check DevTools)
- Performance meets targets
- Error scenarios handled gracefully
- Multiple simultaneous users work
- Load testing passed (if applicable)
- HTTPS enabled on both frontend and backend
- Environment variables not exposed in client
- Rate limiting configured (if applicable)
- Input validation working
- SQL injection prevention verified
- XSS prevention verified
- CSRF protection configured (if applicable)
Option 1: Via Railway Dashboard
- Go to Railway project dashboard
- Click on Deployments tab
- Find previous working deployment
- Click "Redeploy"
Option 2: Via Railway CLI
# View deployment history
railway logs --deployment <deployment-id>
# Rollback to specific deployment
railway rollback <deployment-id>Option 3: Git Revert
# Find commit to revert to
git log --oneline
# Revert to previous commit
git revert <commit-hash>
git push origin main
# Railway will auto-deployOption 1: Via Vercel Dashboard
- Go to Vercel project dashboard
- Click on Deployments tab
- Find previous working deployment
- Click "Promote to Production"
Option 2: Via Vercel CLI
# List deployments
vercel ls
# Promote specific deployment
vercel promote <deployment-url>Option 3: Git Revert
# Find commit to revert to
git log --oneline
# Revert to previous commit
git revert <commit-hash>
git push origin main
# Vercel will auto-deploy- Identify the issue and severity
- Notify team members
- Execute rollback procedure
- Verify rollback successful
- Update status page (if applicable)
- Document incident
- Schedule post-mortem
- Fix issue in development
- Test fix thoroughly
- Deploy fix when ready
Estimated Total Time: 2-3 hours
- Pre-deployment verification: 30 minutes
- Backend deployment: 30 minutes
- Frontend deployment: 30 minutes
- Post-deployment verification: 30-60 minutes
- Monitoring and adjustments: 30 minutes
Technical Lead: [Name and contact] DevOps: [Name and contact] Backend Developer: [Name and contact] Frontend Developer: [Name and contact]
Last Updated: 2025-12-05 Version: 1.0.0