Case Study

FairShare.

A full-stack expense splitting app with a financial-grade backend and cross-platform mobile client.

Year
2025
Role
Solo Developer
FairShare

01

About

FairShare is a Splitwise alternative built from scratch — a production-grade expense management system that lets groups of people track shared costs, split bills multiple ways, and settle debts with minimal transactions. The project has two parts: a REST API built with NestJS and a React Native mobile app built with Expo. Both were built solo, end to end. Backend: NestJS · TypeScript · PostgreSQL · Redis · TypeORM · JWT · Google OAuth · AWS S3 · Sentry. Mobile: React Native · Expo · Expo Router · TanStack Query · Zustand · NativeWind · Zod · Sentry.

02

Challenges

The core architectural challenge was designing the system as a financial ledger rather than a CRUD app — balances are always fully derived by replaying all expenses and settlements, never stored as a mutable number. Concurrent writes required group-level pessimistic locking (SELECT FOR UPDATE) to prevent race conditions during balance rebuilds. Mobile reliability required an idempotency key infrastructure backed by Redis so retried requests never create duplicate expenses. Multi-step expense creation on mobile was handled via a dedicated Zustand draft store shared across three screens. Token security was addressed by keeping access tokens only in memory and persisting the refresh token exclusively in Expo SecureStore (iOS Keychain / Android EncryptedSharedPreferences), with proactive refresh one minute before expiry. Finally, a greedy debt simplification algorithm reduces up to N² pairwise debts to the minimum number of transactions needed to fully settle a group.

03

Results

Built a complete financial application — backend and mobile — solo, from schema design to production-ready code. 38 backend spec files covering services, controllers, guards, interceptors, and filters. 121 mobile tests covering stores, hooks, services, schemas, and components. Implemented non-trivial backend patterns rarely seen in personal projects: pessimistic locking for concurrent financial writes, idempotency key infrastructure, CQRS-style read/write model separation, and a debt simplification algorithm. Implemented non-trivial mobile patterns: proactive token refresh with secure storage, multi-step form state via draft stores, deep-link invite flow, and push notification routing to specific screens.