
PayPi
Simulated Payment Infrastructure with Webhook Event System
Paypi is a digital wallet application that supports two core flows: adding money via a bank gateway with OTP verification, and instant peer-to-peer wallet transfers. The add-money flow uses a webhook-driven pattern — the bank posts the payment result back to Paypi, which updates the transaction status from pending to success or failed. The frontend polls the database and reacts in real time without a page refresh. Transfers use an atomic database transaction with row-level locking to prevent double-spend.
Built with React, Node.js, and PostgreSQL. Key concepts: webhook verification, polling, atomic transactions, and concurrency-safe balance updates.
System architecture
Paypi / How it works
A digital wallet platform. Each service is responsible for exactly one thing.

Scaling guide
Paypi — shortcomings & fixes
6 areas to address before taking Paypi to production scale.
Recommended fix order: Webhook idempotency → Rate limiting → DB queue → Polling → Split DB → Transaction TTL
Priority summary
1
Critical
3
High
2
Medium
0
Low
