Inspiration
Splitting a night out is almost never equal, and it is almost always awkward. One friend had a salad, another had steak, everyone shared dessert, and then someone has to chase the group for money days later. Split the Night was built to make that fair and painless, especially for a group of friends who just want to enjoy the night.
What it does
Enter who was there and what was spent, including shared items, items shared by only some friends, and individual items. The AI agent turns that messy list into a fair split, not just an equal split, and explains each share in plain language. It also drafts a friendly payment request for each friend.
Each friend then pays her share through PayPal sandbox checkout. The dashboard shows the total, what has been collected, what is still outstanding, and who has paid and who has not.
Try the preloaded sample night: dinner, shared dessert, and individual drinks come to $162.36 in total, split as Maya $35.67, Priya $52.89, Sofia $47.97, and Lena $25.83.
How we built it
Plain HTML, CSS, and vanilla JavaScript, with no backend and no build step. The only external script ever loaded is the official PayPal JavaScript SDK, and only in real sandbox mode.
PayPal works in two modes, by design. By default the hosted demo runs in sandbox demo mode so judges can run the full flow with no credentials and no real money moves. With a PayPal sandbox Client ID pasted into config.js, it loads real PayPal sandbox Buttons for each share. Only the Client ID is used in front-end code, never a Client Secret, and the README notes that a live production integration would move order creation and capture server-side.
The fair-split logic is tested: 22 automated tests pass, covering equal splits, shared subsets, individual items, proportional tax and tip, and rounding to cents so shares always sum exactly to the total.
Challenges we ran into
The hard part was not the total, it was fairness and rounding. Shared items, partial sharing, and tax and tip all interact, and cents have to add up exactly or the organizer is left short. We solved it with cent-level largest-remainder distribution for tax and tip, so the shares sum exactly to the total.
We also had to keep the PayPal demo honest and usable at the same time. A demo that needs credentials before it works is hard for judges to try, and a demo that pretends to move money is misleading. The two-mode approach was the answer: a clearly labelled sandbox demo by default, and real sandbox as an opt-in.
What we learned
A fair split is an explanation problem as much as a math problem. People accept a share when they can see why it is theirs. That is why every share comes with a plain-language breakdown, not just a number.