Live
Basecamp
INR-first trip cost splitter that settles a group up in at most n−1 payments, with UPI links and shareable statements.
Next.js / TypeScript / Supabase / PostgreSQL / Vercel
Visit siteSplitting a trip in at most n−1 payments
Basecamp splits the cost of a trek, road trip, beach week or house share. Settle-up repeatedly pairs the largest debtor with the largest creditor; each step clears at least one person, so a group of n settles in at most n−1 transfers. Finding the true minimum is NP-hard, and the greedy plan is stable, so it does not reshuffle each time someone opens the page. Payments to anyone with a UPI ID come with a prefilled UPI link.
Splits that add up to the paisa
An expense can be split equally, by shares, by percentage or by exact amounts, with several payers and anyone left out who was not there. Amounts are integer counts of paise: every share is floored, then the leftover paise go one at a time to whoever was rounded down most, so ₹100 between three people becomes 33.34, 33.33 and 33.33. The same split module runs in the browser's live preview and in the server action, so the preview shows what will be stored.
Keeping the ledger and invites correct in Postgres
Deferred constraint triggers check at commit that an expense's payers and splits each sum to its total, so no client or migration can unbalance the ledger. One Postgres function saves an expense with its payers and splits, running as the calling user so row-level security still decides who may write. Balances are a view over the ledger, not a stored column, and expenses are soft-deleted to keep an audit trail.
Someone without an account can be added as a placeholder who carries a real balance; redeeming an invite aimed at that placeholder adopts it, debt and history included. Redemption locks the invite row, so two people cannot both use a single-use link.
One statement, four outputs
A statement is computed once and rendered as a printable page, a PDF, a CSV and a read-only public link. The PDF embeds a subset of Noto Sans because the built-in PDF fonts have no rupee sign. The CSV adds a UTF-8 byte order mark and prefixes any field starting with =, +, - or @ against formula injection. The public link carries names and figures only: no email addresses, UPI IDs or record ids.