Skip to content

Latest commit

 

History

History
230 lines (180 loc) · 6.86 KB

File metadata and controls

230 lines (180 loc) · 6.86 KB

🚀 Production Deployment Checklist

Project: XMRT Ecosystem
Database: vawouugtzwmejxqkeqqj.supabase.co
Frontend: Vercel (devgru-projects/v0-git-hub-sync-website)


✅ Phase 1: Security (CRITICAL - Must Complete First)

Database Security

  • RLS policies enabled on memory_contexts table
  • Function search_path set to public for all custom functions
  • Database linter warnings resolved
  • Review all table RLS policies for completeness
  • Test RLS policies with different user roles
  • Verify no public access to sensitive user data

Edge Function Authentication

  • Protected AI chat functions (deepseek, gemini, openai) require JWT
  • Protected management functions (agent-manager, code-monitor) require JWT
  • Public health/monitoring endpoints configured correctly
  • Test authenticated endpoints with valid JWT
  • Test authenticated endpoints reject invalid JWT
  • Verify public endpoints remain accessible

API Keys & Secrets

  • All API keys stored in Supabase secrets (not .env)
  • Rotate any exposed API keys
  • Verify CORS settings for production domain
  • GitHub PAT has minimum required scopes
  • OpenAI/Gemini/DeepSeek keys have rate limits set

✅ Phase 2: Code Quality

Logging

  • Production logger utility created (src/utils/logger.ts)
  • Replace all console.log with logger.debug (62 files)
  • Replace all console.warn with logger.warn
  • Replace all console.error with logger.error
  • Test logging in development mode
  • Test logging suppression in production mode

Data Validation

  • Add UUID validation before database inserts
  • Add JSON schema validation for edge function payloads
  • Test session key generation (ensure proper UUID format)
  • Verify no "invalid input syntax" errors in logs

Code Cleanup

  • Review and address critical TODO/FIXME comments
  • Remove unused imports and dead code
  • Update TypeScript strict mode compliance
  • Run ESLint and fix all errors/warnings

✅ Phase 3: Performance

Database Optimization

  • Indexes created on conversation_messages table
  • Indexes created on memory_contexts table
  • Indexes created on eliza_activity_log table
  • Indexes created on webhook_logs, frontend_events, api_call_logs
  • Test query performance on large tables
  • Verify index usage with EXPLAIN ANALYZE
  • Schedule old data cleanup (>90 days)

Rate Limiting

  • Rate limiting table created
  • increment_rate_limit() function created
  • Add rate limiting middleware to public edge functions
  • Set appropriate rate limits per endpoint
  • Test rate limiting with load tests
  • Configure rate limit error responses

Caching

  • Review edge function caching opportunities
  • Add caching headers to static assets
  • Configure CDN caching rules
  • Test cache invalidation strategy

✅ Phase 4: Monitoring

Health Checks

  • system_health_summary view created
  • check-frontend-health function deployed
  • Configure uptime monitoring (UptimeRobot, Better Stack)
  • Set up alerting for frontend downtime
  • Test health check endpoints

Error Tracking

  • Integrate Sentry or similar error tracking
  • Configure error alerting rules
  • Test error capture in production
  • Set up error dashboard

Performance Monitoring

  • Configure Vercel analytics
  • Set up Supabase database monitoring
  • Create custom dashboard for business metrics
  • Configure slow query alerts
  • Set up edge function performance monitoring

Logging & Debugging

  • Configure log aggregation (Supabase logs + Vercel logs)
  • Set up log retention policy
  • Create runbook for common errors
  • Test log search and filtering

✅ Phase 5: Deployment

Pre-Deployment

  • Run full test suite
  • Test on staging environment
  • Verify environment variables in Vercel
  • Verify secrets in Supabase
  • Backup database before deployment
  • Create rollback plan

Deployment

  • Deploy to Vercel production
  • Verify all edge functions deployed
  • Run smoke tests on production
  • Monitor error rates for 1 hour
  • Verify health checks passing

Post-Deployment

  • Test critical user flows
  • Monitor database performance
  • Check error tracking dashboard
  • Verify monitoring/alerting working
  • Update documentation with production URLs

✅ Phase 6: Documentation

Technical Documentation

  • Production deployment checklist created
  • Update README with production architecture
  • Create runbook for common issues
  • Document environment variable requirements
  • Create database schema documentation
  • Document API endpoints and authentication

User Documentation

  • Update user guides for production features
  • Create FAQ for common issues
  • Document support escalation process

🚨 Emergency Procedures

Rollback Plan

  1. Database: Run supabase db reset to rollback migrations
  2. Code: Revert to previous Git commit and redeploy
  3. Edge Functions: Previous versions retained, can redeploy
  4. Maintenance Mode: Enable if critical issue detected

Critical Issue Response

  1. Check health dashboard immediately
  2. Review error logs for root cause
  3. If data loss risk: enable read-only mode
  4. Notify stakeholders via status page
  5. Implement hotfix or rollback
  6. Post-mortem after resolution

Support Contacts

  • Database Issues: Supabase Support
  • Frontend Issues: Vercel Support
  • Security Issues: Escalate immediately
  • Business Critical: [Define escalation path]

📊 Success Metrics

Security

  • ✅ Zero public access to user data without auth
  • ✅ All linter errors resolved
  • ⏳ Rate limiting active on all public endpoints
  • ⏳ Zero UUID/JSON validation errors in logs

Performance

  • ⏳ Database queries < 100ms (95th percentile)
  • ⏳ Edge function cold start < 2s
  • ⏳ Frontend uptime > 99.9%
  • ⏳ No slow query alerts

Code Quality

  • ⏳ Zero console.log in production
  • ⏳ All critical TODOs addressed
  • ⏳ ESLint passing with no warnings

Monitoring

  • ⏳ Health dashboard operational
  • ⏳ Error alerting configured
  • ⏳ Daily automated health reports

📝 Sign-off

Checklist Completed By: ________________
Date: ________________
Deployment Approved By: ________________
Date: ________________


🔗 Important Links


Last Updated: 2025-10-12
Version: 1.0.0