Menu

Post image 1
Post image 2
1 / 2
0

I shipped a hospital management system to production. Here's what actually broke.

DEV Community·Alay Sharma·26 days ago
#61lhBsgj
#python#webdev#devops#fastapi#selenium#every
Reading 0:00
15s threshold

Everyone ships demos. Localhost is kind — it has no users, no retries, no race conditions, no 3am failures. Production is where your assumptions get stress-tested by reality. I built and deployed a full hospital management system: FastAPI backend, React web frontend, Flutter mobile app, Supabase PostgreSQL, Razorpay payments, Redis queues, and WhatsApp notifications via Selenium. Here's the post-mortem on what actually broke and how I fixed it. 1. Razorpay webhook idempotency — naive payment handling double-charges users Razorpay retries failed webhooks. So does every serious payment processor. If your handler isn't idempotent, a network blip between their retry and your database write means you process the same event twice. The user gets charged once. Your DB thinks they paid twice. Chaos. The fix isn't clever code — it's a database constraint. I added a deduplication_key column on the payment_webhooks table with a unique index. Every webhook payload carries a Razorpay event ID.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More