← All Projects
DiviMate

DiviMate

Comprehensive expense app with offline-first architecture, multi-currency support, and smart debt simplification

redux
offline-first
supabase
sqlite
authentication
react-native
typescript
mobile
backend
testing
i18n
notifications
google-gemini
app-hero

Problem

Splitting expenses in groups with multiple currencies, partial payments, and complex debt chains is a problem that existing apps handled poorly — either requiring constant internet access, lacking real settlement logic, or having UX that broke down with more than three people in a group.

Stack Decisions

SQLite + Supabase for offline-first sync

All writes go to local SQLite first so the app is fully functional without a connection. Supabase sync runs in the background and resolves conflicts using a last-write-wins strategy with server timestamps as the source of truth.

Redux with async thunks

Eight slices cover groups, expenses, settlements, currencies, notifications, and sync state. Async thunks make the local→remote write sequence explicit and testable, and selectors memoize derived views like per-member balances.

Expo IAP for subscriptions

Using Expo's in-app purchase abstraction kept the billing code platform-agnostic. Purchase receipts are validated server-side via Supabase Edge Functions before unlocking premium features.

npm utility package

Shared business logic (debt simplification, AES-256 encryption, currency conversion) was extracted into a published npm package so the React Native app and the Next.js web app run identical algorithms without code duplication.

Challenges

01

Debt simplification algorithm

Reducing N-way debts to the minimum number of transactions is a variant of the subset-sum problem. The implementation uses a greedy creditor-debtor matching that reliably produces optimal results for typical group sizes without exponential complexity.

02

Offline conflict resolution

When the same expense is edited on two devices while offline, both writes reach Supabase on reconnect. The sync layer detects conflicts by comparing local and remote updated_at timestamps and surfaces them to the user rather than silently overwriting.

03

Multi-currency balance tracking

Groups can mix currencies per expense. Displaying a single settlement amount required choosing a display currency and running all balances through a live exchange rate snapshot, cached locally to avoid flicker on every render.

Outcome

Live on Google Play with offline-first architecture, real-time messaging, AI receipt scanning, and an accompanying npm utility package. The debt simplification logic consistently reduces 6-person group settlements from 15 transactions to 4–5, which became the most-cited feature in user reviews.