Design an online donation platform for a consumer application.
Users should be able to discover donation campaigns or nonprofit organizations, make one-time or recurring donations, receive receipts, and view donation history. Nonprofit organizations should be able to receive payouts and view basic reporting. Internal admins should be able to create, approve, pause, and audit campaigns.
Assume:
-
Millions of registered users.
-
Donations are processed through an external payment provider.
-
Donation spikes can occur during major campaigns or disasters.
-
The system must avoid duplicate charges and preserve a reliable audit trail.
-
Notifications and analytics can be eventually consistent, but payment and ledger correctness are critical.
Discuss functional requirements, APIs, data model, high-level architecture, payment flow, transaction correctness, reliability, scalability, and tradeoffs.