Priority: P3 — Low
Problem
chainreview-api/src/routes/health.ts exists but likely returns a minimal response (e.g., { status: 'ok' }). A meaningful health check should verify connectivity to all upstream dependencies.
Solution
Enhance the health endpoint to check:
GET /health
Response:
{
"status": "healthy" | "degraded" | "unhealthy",
"version": "1.2.3",
"checks": {
"database": { "status": "healthy", "latency_ms": 12 },
"supabase": { "status": "healthy", "latency_ms": 45 },
"anthropic": { "status": "healthy", "latency_ms": 120 },
"stripe": { "status": "healthy", "latency_ms": 89 }
},
"timestamp": "2026-03-05T10:00:00Z"
}
Implementation
- Database: Run a simple
SELECT 1 query
- Supabase: Check auth service liveness
- Anthropic: Optional lightweight check (or just verify key format to avoid unnecessary API calls)
- Stripe: Optional check against Stripe's status API
Behavior
- Overall
status = "degraded" if any non-critical check fails
- Overall
status = "unhealthy" if critical checks (database) fail
- Respond with 200 for "healthy"/"degraded", 503 for "unhealthy"
- Cache responses for 10 seconds to prevent hammering upstream services
Use cases
- Cloudflare Workers health checks
- Uptime monitoring (UptimeRobot, Better Stack)
- Kubernetes liveness/readiness probes (if self-hosted)
Acceptance Criteria
Priority: P3 — Low
Problem
chainreview-api/src/routes/health.tsexists but likely returns a minimal response (e.g.,{ status: 'ok' }). A meaningful health check should verify connectivity to all upstream dependencies.Solution
Enhance the health endpoint to check:
Implementation
SELECT 1queryBehavior
status= "degraded" if any non-critical check failsstatus= "unhealthy" if critical checks (database) failUse cases
Acceptance Criteria
/healthreturns individual dependency check results