← All projects
01 / 10 · Backend · 2026
Auction Platform API
Personal open-source project · Node.js · Express · 37 tests · Docker
A vehicle auction backend built around the hard parts of bidding: simultaneous bids, last-second sniping, retried requests and notifications that must never slow a bid down.
The problem
Auction systems look simple until two people bid in the same millisecond, a phone on a weak signal sends the same bid twice, or someone waits for the last second to win. I wanted a small, readable code base that handles all of that correctly, with tests that prove it.
What I did
Optimistic locking on a version column: a write that loses the race gets 409 bid_conflict instead of silently overwriting.
Anti-sniping: a bid in the final two minutes extends the close by two minutes.
Idempotency-Key header: a retried request returns the first result; a reused key with a different amount is refused.
An event bus (a stand-in for Azure Service Bus) decouples outbid/win notifications and the audit log, with retries and a dead-letter queue.
Also includes a fleet GPS telemetry ingest (202 Accepted, de-duplication, out-of-order handling) and Indonesian-style document numbering.
HS256 JWT and scrypt on node:crypto, a MySQL schema that mirrors the in-memory repositories, OpenAPI docs, Docker + Nginx and CI.
Outcome
37 automated tests (node:test + supertest) covering every bidding rule, token tampering, rate limiting and CORS.
Runs with zero set-up; the seed always produces live, ending-soon, scheduled and closed auctions.
Related writing
20 October 2026 · 4 min read
Designing a bidding engine: concurrency, anti-sniping and idempotency
The rules behind a fair online auction and how to enforce them in code: optimistic locking, extending the close on late bids, safe retries and event-driven notifications.
Read article →