A shop for products from Pará built with Spring Boot + Angular, with a checkout designed to never charge twice: idempotency, transactional outbox, webhooks and Kafka.
Context
A purchase touches the database, stock, coupons and an external payment provider over HTTP. A double click, a crash midway or a provider timeout can duplicate the charge or leave orphan state.
Solution
Seven reliability guarantees, each tied to the code and the test that exercises it: a per-purchase idempotency key, all-or-nothing acceptance, no overselling, charge intent persisted before the external call (outbox), provider call outside a transaction with a lease, a webhook that never confirms payment by itself, and idempotent consumers.
What it shows
- Over 280 backend tests, with CI on GitHub Actions.
- Local demo: the payment provider is still simulated.
- Shows how to handle partial failures, not only the happy path.