Operations
This is the on-call runbook. It covers how to deploy, monitor, respond to
incidents, and recover from failures. When something breaks, jump to
Incident Response and Common Issues & Fixes.
Deployment
Normal Deployment Flow
Work flows in one direction:dev → test → pprd → prod.
1
Merge PR to dev
CI runs lint + typecheck + unit tests.2
Merge dev → test
CI adds integration tests + Playwright + Lighthouse.3
Merge test → pprd
CI adds k6 load test + OWASP ZAP.4
Merge pprd → prod
Requires manual approval, then auto-deploys.Emergency Hotfix
For critical production bugs that can’t wait for the full pipeline:Rollback
- Tab Title
- Tab Title
- Tab Title
Customer + admin sites (
rgss-web, rgss-admin) — Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare):- Run
wrangler rollbackfor the affected Worker, or open Cloudflare → Workers & Pages →rgss-web→ Deployments - Find the last known-good deployment / version
- Promote it — takes effect in ~30 seconds
Monitoring
Daily Checks (2 minutes)
1
Status page
Check BetterStack status page — all monitors green?2
Errors
Check Sentry — any new error issues overnight?3
Jobs
Check BetterStack heartbeats — did all scheduled jobs run?Weekly Checks (15 minutes)
1
Funnel
Review PostHog funnel — any drop-off increase in booking flow?2
Error trends
Review Sentry error trends — any new patterns?3
Performance
Check Lighthouse CI scores on recent PRs — any performance regression?4
Load
Review k6 load test results — any latency increase?Alerts
Incident Response
Severity Levels
P0/P1 Response Steps
1
Acknowledge
Post in Slack#incidents that you’re investigating.2
Diagnose
Check BetterStack, Sentry, Cloudflare, Render, Neon dashboards.3
Communicate
Update the BetterStack status page with an incident message.4
Fix or rollback
Deploy a fix or roll back to the last known-good deployment.5
Verify
Confirm Checkly synthetic checks pass.6
Post-mortem
Document what happened, why, and how to prevent it.Common Issues & Fixes
Database Operations
Running Migrations
Never run migrations directly on prod without testing on test + pprd first.
Neon Branch Management
Point-in-Time Restore
If a bad migration or data corruption occurs on prod:1
Open the branch
Go to Neon console → Project → Branches →prod.2
Restore to a point in time
Click “Restore” → select a point in time before the incident.3
Verify
This creates a new branch — verify data is correct.4
Swap the connection
Point the connection string to the restored branch.5
Re-apply migrations
Apply any migrations that happened after the restore point.Backup & Recovery
Weekly Backups
Every Sunday at 2 AM UTC, GitHub Actions:- Runs
pg_dumpagainst Neonprodbranch - Uploads compressed dump to Cloudflare R2 (
backups/weekly/) - Retains 8 weeks of backups
- Pings BetterStack heartbeat on success
Restore from Backup
Scaling
The platform is designed to scale without code changes:Launch Checklist
Before going live attheroyalglow.in:
- DNS: point
theroyalglow.in→ Cloudflare Workers (rgss-web) - DNS: point
admin.theroyalglow.in→ Cloudflare Workers (rgss-admin) - DNS: point
cms.theroyalglow.in→ Render (rgss-cms) - DNS: point
docs.theroyalglow.in→ Cloudflare Workers (docs) - DNS: point
status.theroyalglow.in→ BetterStack status page - SSL: verify all domains have valid certificates (Cloudflare handles this)
- GMB: update website field from old URL to
https://theroyalglow.in - GMB: set booking action link to
https://theroyalglow.in/?book=1&utm_source=gmb - Google Search Console: verify ownership, submit sitemap
- Sentry: verify source maps are uploading correctly
- BetterStack: verify all monitors are active and alerting
- Checkly: verify all synthetic checks are passing
- Run Lighthouse CI on all key pages — all scores must pass
- Test booking flow end-to-end on prod
- Test Google OAuth sign-in on prod
- Test invoice email delivery on prod
- Seed production data (branch, categories, services, tiers)