Skip to main content

Deployment Quick Reference

Essential commands and URLs for production deployment.

🚀 Deployment Commands

Pre-Deployment

# Run pre-deployment checks
./scripts/pre-deployment-check.sh

# Verify Convex environment
npx convex env list --prod

# Run all tests
pnpm test

# Build locally to verify
pnpm run build

Deploy Convex

# Deploy to production
npx convex deploy --prod

# Watch logs
npx convex logs --prod --watch

# List deployments
npx convex deployments list --prod

Deploy Frontend

# Merge and push to main
git checkout main
git pull origin main
git merge staging
git push origin main

Post-Deployment

# Verify deployment
PRODUCTION_URL=https://dashtray.com \
CONVEX_URL=https://your-project.convex.site \
./scripts/post-deployment-verify.sh

# Test homepage
curl -I https://dashtray.com

# Watch Convex logs
npx convex logs --prod --watch

🔧 Environment Variables

Set Convex Variables

npx convex env set SITE_URL "https://dashtray.com" --prod
npx convex env set BETTER_AUTH_SECRET "$(openssl rand -base64 32)" --prod
npx convex env set RESEND_API_KEY "re_xxxxx" --prod
npx convex env set RESET_EMAIL_FROM "noreply@dashtray.com" --prod
npx convex env set MASTER_ENCRYPTION_KEY "$(openssl rand -hex 32)" --prod
npx convex env set DODO_PAYMENTS_API_KEY "dodo_xxxxx" --prod
npx convex env set DODO_PAYMENTS_ENVIRONMENT "production" --prod

List Convex Variables

npx convex env list --prod

Generate Secrets

# Generate Better Auth secret
openssl rand -base64 32

# Generate encryption key
openssl rand -hex 32

🔄 Rollback Commands

Rollback Convex

# List deployments
npx convex deployments list --prod

# Rollback to specific deployment
npx convex deployments rollback <deployment-id> --prod

Rollback Git

# Revert last commit
git revert HEAD
git push origin main

# Reset to specific commit (use with caution)
git reset --hard <commit-hash>
git push origin main --force

📊 Monitoring Commands

Check Logs

# Convex logs (live)
npx convex logs --prod --watch

# Convex logs (last 100 lines)
npx convex logs --prod --tail 100

# Filter logs
npx convex logs --prod | grep "error"
npx convex logs --prod | grep "webhook"

Test Endpoints

# Homepage
curl -I https://dashtray.com

# Login page
curl -I https://dashtray.com/login

# API health (if available)
curl https://your-project.convex.site/api/health

# Test with timing
curl -w "@curl-format.txt" -o /dev/null -s https://dashtray.com

Check SSL

# Check SSL certificate
openssl s_client -connect dashtray.com:443 -servername dashtray.com

# Check HSTS header
curl -I https://dashtray.com | grep strict-transport-security

🔗 Important URLs

Production

Development

External Services

📝 GitHub Secrets

Set in: Settings → Secrets and variables → Actions

Required Secrets

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID
  • BETTER_AUTH_SECRET

Required Variables

  • PUBLIC_CONVEX_URL
  • PUBLIC_CONVEX_SITE_URL
  • SITE_URL
  • CLOUDFLARE_PROJECT_NAME
  • BETTER_AUTH_URL

🔍 Troubleshooting

Build Fails

# Check build locally
pnpm run build

# Check Node version
node -v  # Should be 20+

# Clear cache and rebuild
rm -rf .svelte-kit node_modules
pnpm install
pnpm run build

Convex Deploy Fails

# Check authentication
npx convex dev

# Check for syntax errors
npx convex typecheck

# Try manual deploy
npx convex deploy --prod --verbose

Environment Variables Not Loading

# List Convex variables
npx convex env list --prod

# Check GitHub secrets (in GitHub UI)
# Check Cloudflare Pages variables (in Cloudflare UI)

Webhooks Not Working

# Check Convex logs for webhook events
npx convex logs --prod | grep webhook

# Test webhook manually in DodoPayments dashboard
# Verify webhook URL is correct

📞 Support

Emergency Contacts

Documentation

🎯 Success Criteria

Deployment is successful when:
  • ✅ All smoke tests pass
  • ✅ Error rate < 1%
  • ✅ Response time < 2s (p95)
  • ✅ No critical bugs reported
  • ✅ All integrations working
  • ✅ Webhooks processing correctly
  • ✅ Monitoring shows normal metrics

📅 Deployment Schedule

Recommended Windows:
  • Tuesday-Thursday, 10 AM - 2 PM (local time)
Avoid:
  • Fridays, weekends, holidays, late nights
Maintenance Window:
  • Announce 24 hours in advance
  • Duration: 1-2 hours
  • Rollback plan ready

🔐 Security Checklist

Before deploying:
  • All secrets rotated (if needed)
  • No hardcoded credentials
  • Environment variables verified
  • SSL certificate valid
  • HSTS enabled
  • Rate limiting active
  • Webhook signatures verified
  • API authentication required

📈 Post-Deployment

Within 24 hours:
  • Monitor error logs
  • Check user feedback
  • Verify all integrations
  • Review performance metrics
  • Update team on status
  • Document any issues
  • Plan next release