Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 562 Bytes

File metadata and controls

40 lines (29 loc) · 562 Bytes

Payment Service

Endpoint

POST /pay

{ "userId": 1, "amount": 10, "requestId": "abc-123" }

Symptoms

  • Duplicate charges
  • 200 OK but no DB record
  • Instability under load

Setup

bun i
bun run db:init
bun run dev

Load test

bun run load

Architecture

src/
├── server.js      # Express server on :3000
├── payRoute.js    # Payment endpoint
└── db.js          # SQLite helpers
  • SQLite database in db/app.sqlite
  • External payment provider (AWS Lambda, no local setup needed)