Urgent.News

What's breaking now, across thousands of outlets.

Tech

Designing a Concurrent Donation Ledger With FastAPI and PostgreSQL

Inside GoodCause’s Expo, FastAPI, PostgreSQL, Paystack, and RevenueCat architecture for processing donations and tracking campaign allocations.

Designing a Concurrent Donation Ledger With FastAPI and PostgreSQL

GoodCause, a social impact crowdfunding platform, aimed to eliminate transparency issues by building a system that guarantees financial integrity, atomic fund distribution, and a seamless cross-platform mobile experience. The project employed React Native, FastAPI, and PostgreSQL to create an auditable impact ledger and ensure data integrity in concurrent donation scenarios.

The system architecture is built on three core principles: Mobile-First Delivery, Atomic Auditability, and Strict Data Isolation. The frontend is developed using React Native and Expo Router, while the backend utilizes Python FastAPI for domain-driven routing. Supabase provides the database (PostgreSQL) and Row-Level Security (RLS) policy enforcement, while the RevenueCat SDK manages subscriptions, and Paystack handles payment processing with webhook verification using HMAC-SHA512 signatures.

The main challenge was preventing race conditions and double-spending during concurrent donations and automated payouts. To address this, GoodCause implemented PostgreSQL Common Table Expressions (CTEs) as atomic SQL execution units. This approach executes all table updates within a single transaction block, ensuring no two processes can simultaneously alter the same data without proper coordination.

By storing currency values as 64-bit integers, GoodCause avoids floating-point arithmetic drift during aggregation, ensuring precise financial tracking. The system evaluates milestones and triggers automated notifications upon successful atomic verification, notifying organizers and campaign followers when specific progress thresholds are reached. The client-side implementation uses expo-secure-store for secure session token storage, preventing token leakage on jailbroken or rooted devices.

Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at hackernoon.com →

More in Tech

Satellite software provider Satlyt closes $8M investment

Satlyt Inc., a startup that develops artificial intelligence software for satellites, has raised $8 million in funding. TechCrunch reported today that the seed round was led by early-stage fund Non Sibi Ventures. Satlyt was founded in 2024 by Chief Executive Rama Afullo (pictured, second from the left).

Kaspersky warns of growing online risks for children

ISLAMABAD: A leading cybersecurity company on Thursday warned Pakistanis that young users may encounter cybersecurity threats while using platforms including multiplayer online games and AI. Kaspersky’s experts have examined the digital interests and online activity of children across the META region including Pakistan, identifying the…

More from Friday 2 October →