Problem
The microservices architecture introduces real distributed-systems failure modes (Redis down, indexer worker crashed, RPC unreachable) but the README only mentions /metrics for Prometheus scraping — there's no lightweight /healthz//readyz for orchestrators (Docker Compose healthchecks, PM2, k8s if ever adopted) to use for restart/alerting decisions.
Proposed work
Add /api/health (liveness: is the process up) and /api/ready (readiness: can Redis be reached, is the indexer's last-seen ledger within an acceptable lag window) endpoints to server-decoupled.ts.
Wire the existing docker-compose.microservices.yml services to use these for their healthcheck blocks instead of (presumably) no healthcheck or a naive TCP check.
Document expected response shapes and status codes in MICROSERVICES_ARCHITECTURE.md.
Acceptance criteria
Killing the Redis container causes /api/ready to report unhealthy within one polling interval, verified manually or via test.
Docker Compose correctly restarts/holds back dependent services based on these healthchecks.
Endpoints return structured JSON (not just 200/500) so monitoring tools can distinguish which dependency failed.
Problem
The microservices architecture introduces real distributed-systems failure modes (Redis down, indexer worker crashed, RPC unreachable) but the README only mentions /metrics for Prometheus scraping — there's no lightweight /healthz//readyz for orchestrators (Docker Compose healthchecks, PM2, k8s if ever adopted) to use for restart/alerting decisions.
Proposed work
Add /api/health (liveness: is the process up) and /api/ready (readiness: can Redis be reached, is the indexer's last-seen ledger within an acceptable lag window) endpoints to server-decoupled.ts.
Wire the existing docker-compose.microservices.yml services to use these for their healthcheck blocks instead of (presumably) no healthcheck or a naive TCP check.
Document expected response shapes and status codes in MICROSERVICES_ARCHITECTURE.md.
Acceptance criteria
Killing the Redis container causes /api/ready to report unhealthy within one polling interval, verified manually or via test.
Docker Compose correctly restarts/holds back dependent services based on these healthchecks.
Endpoints return structured JSON (not just 200/500) so monitoring tools can distinguish which dependency failed.