Skip to content

Splibilo

A group expense system that turns shared spending into clear balances and fewer settlement transactions.

GitHub

Year
2026
Type
Full-stack System
Focus
Financial workflows, settlement logic, OCR
Stack
Next.js · NestJS · PostgreSQL · Prisma
On this page
Splibilo preview

Overview

Splibilo is a group expense platform for recording shared spending, splitting costs, tracking balances, and settling debts. Users can create groups, add equal or custom expense splits, upload receipts, see what each member owes, and generate settlement suggestions.

The interesting part was not the expense form itself. It was keeping the financial state consistent as expenses, custom shares, edits, and settlements all affected the same set of balances.

Problem

Shared expenses become difficult once "who paid" and "who owes" stop being the same thing. One edit can affect several members at once, and a partial update can make the group's balances unreliable.

The system needed to keep those relationships consistent while still making the user-facing flow feel simple.

Keeping financial updates atomic

Creating or editing an expense touches several related records. If only part of that operation succeeds, the stored shares and resulting balances can disagree.

Splibilo handles expense and share updates transactionally so the operation succeeds as one unit or rolls back together. This made transaction boundaries part of the feature design rather than something hidden in the database layer.

Reducing settlement friction

A group's debt can quickly become a network of small "A owes B" relationships that is difficult to settle manually. Splibilo first computes each member's net position:

total paid - total owed + settlements received - settlements sent

It then separates creditors and debtors and applies a greedy two-pointer strategy to generate a smaller set of settlement suggestions. The algorithm runs in O(n log n) because the balances are sorted before matching.

Turning receipt images into structured data

Receipt images are noisy input. Instead of asking one model to solve the entire problem, Splibilo uses a small pipeline:

Sharp → Tesseract.js → Gemini

Sharp prepares the image, Tesseract extracts raw text, and Gemini turns that text into structured receipt fields such as items, subtotal, tax, and total. The structured result can prefill the expense flow while still leaving the user in control of the final data.

Confidence through testing

Financial calculations are difficult to trust when changes can silently affect several records. The backend includes unit and end-to-end testing, with the repository documenting more than 90% backend test coverage. The tests protect calculations, permissions, and multi-step flows where regressions are easy to miss manually.

Engineering Takeaways

Splibilo made me more conscious of the difference between a feature working and the state behind the feature staying correct. Financial workflows forced me to think more carefully about transaction boundaries, deterministic calculations, validation, authorization, and failure paths.