chore: finalize MVP with health endpoint, healthchecks and end-to-end coverage - #11
Merged
Conversation
GET /health returns { status: 'ok' } as a liveness probe, registered in
a dedicated HealthModule imported by AppModule.
postgres healthcheck now includes -d flag so it validates the target database. app service gets a wget-based probe against /health with start_period: 20s to give the app time to boot before checks begin.
Single scenario: POST /charges → GET /charges/:id (AWAITING_PAYMENT) → POST /webhooks/provider (HMAC-signed payment.confirmed) → GET /charges/:id (PAID). Exercises idempotency, signature guard, state machine, dedup, and persistence across both controllers in a shared in-memory module.
Roadmap split into shipped/v2 sections marking logs, error catalog, CI, and health probe as done. Added AsyncLocalStorage decision entry. Added GET /health to the API section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the MVP scope of the project. Four small but load-bearing pieces:
/api/healthendpoint as a liveness probeappandpostgresservices indocker-compose.yml, withappwaiting forpostgresto be healthy before startingPAIDWhy
The project had every individual piece tested, but no test that wired them all together end-to-end. The new e2e test catches the kind of integration drift that unit tests alone can't: a controller misroutes, a filter doesn't fire, a guard runs in the wrong order. One green test now confirms the system works as a whole.
The healthchecks make
docker compose updeterministic — the app no longer races Postgres on first boot. The/healthendpoint is what any orchestrator (Docker, Kubernetes, ECS) hits to decide if the service is up.Approach
Four atomic commits:
feat: add /health endpointchore: add healthchecks to docker-compose servicestest: add end-to-end happy path covering charge creation through webhookdocs: align README with shipped MVPTests
The new e2e walks through:
POST /chargeswithIdempotency-Key→201, capturescharge_idGET /charges/:id→200, status isAWAITING_PAYMENTPOST /webhooks/providerwith validX-Webhook-Signatureand apayment.confirmedevent →200GET /charges/:id→200, status is nowPAIDTogether with the existing suite, this means every layer of the system has both isolated and integrated coverage.
Notes
start_period: 20son the app healthcheck gives NestJS time to bootstrap before the first probe — without it, Docker can mark the app unhealthy during the first build pass.