XLinkedinGitHub

How I built splitexp. Let's dive deep.

Profile photo
Bhanuka Wijerathne
10 min readJan 7, 2026
Live demo full

Sign in to try the live demo and explore the product hands-on in a safe environment. *Demo credentials are auto-filled for your convenience.

Sign in

Why Splitexp?

Splitexp makes it easy to manage shared expenses with friends. When multiple people pay for a group expense, it clearly identifies who owes whom and how much, so there are no more awkward calculations. Instead of multiple back-and-forth payments, Splitexp finds the easiest way to settle balances between friends, reducing unnecessary transactions and keeping everything simple, fair, and stress-free.

Usage 1Usage 2

Features

Splitexp is designed to simplify group expense handling by making it easy to track, split, and settle shared costs. Here is a complete breakdown of what is already available and what’s coming soon.

What’s Live:
  • Create groups
  • Invite friends via link to join groups with one clicks
  • Add expenses with multiple payers
  • Flexible split options: equal, exact amounts, percentage
  • Track settlements
  • Settle up balances
  • Recent activities
What’s Next:
  • Multi-currency support
  • Recurring expenses and reminders
  • Export reports as PDF/CSV
  • Data visualization charts
Expense form
settle up image

Challenges

Challenge 01: Find the easiest path to settle outstanding balances between two friends
Settle up diagram
How algorithm works:
  • In a group, Mike owes Jane $500 and has already paid her $100.
  • Jane owes Mike $200 and has already paid him $50.
  • The algorithm calculates: (Mike’s total owed to Jane − what Mike paid) − (Jane’s total owed to Mike − what Jane paid).
  • Since the result is positive, Mike still has an outstanding balance of $250 to Jane.
  • If the result is negative, it would mean Jane owes money to Mike instead.
  • The algorithm automatically omits $0 balances and any self balances, so only meaningful outstanding balances remain.
Challenge 02: Find who owes whom in a split when an expense is paid by multiple friends
Split diagram
How algorithm works:
  • In a group expense, total cost is $400 which is split among Mike, Jane, Sophia, and Liam ($100 each).
  • Mike contributes $250 and Jane contributes $150.
  • The algorithm finds the highest contributor (Mike) and keeps splitting his balance until it reaches $0.
  • Then it splits like this: Mike owes $100 to himself, Jane owes $100 to Mike, Sophia owes $50 to Mike and $50 to Jane. Since Mike’s balance reaches $0, the next highest contributor is Jane. Finally, Liam owes $100 to Jane.
  • The algorithm reduces splits by starting with the highest contributor first.

Front-end Architecture

Splitexp is built using the React library and follows the Feature-Sliced Design (FSD) architecture, ensuring a scalable, maintainable, and well-structured front-end codebase. By organizing the application into meaningful slices such as pages, widgets, features, entities, and shared modules, it promotes clear separation of concerns and makes it easier to extend functionality without creating technical debt.

Feature sliced design
Domain driven design

Back-end Architecture

Splitexp is built on top of the Laravel framework and follows Domain-Driven Design (DDD) principles to keep the business logic at the core of development. Instead of structuring the application around technical layers, it is modularized by domains, which allows each module to represent a specific business context clearly and independently. Within a module, you may find Dto, Actions, Factories, Models, and Enums, all working together to encapsulate domain logic while maintaining clean boundaries. This domain-first approach ensures that the codebase remains highly cohesive, easier to reason about, and flexible for future growth, making Splitexp robust and adaptable as business needs evolve.

Automated Deployment

The application uses an automated deployment process powered by a GitHub workflow. This workflow runs tests, builds and pushes Docker images to the container registry, and deploys the updated images to the production environment, ensuring a smooth and reliable release cycle.

Automated deployment

Testing

App is built following Test-Driven Development (TDD) principles using PHPUnit. Before writing any functionality, we first create tests that define the expected behavior. Then we implement the code to pass these tests, ensuring every feature works as intended. This approach helps catch bugs early, maintain high code quality, and makes the application more reliable and easier to refactor over time.

TDD 1TDD 2

Copyright © 2026 Bhanuka Wijerathne. All rights reserved.Sri Lanka