splitlobby
An app that splits a restaurant bill by what each person ate.
SwiftUIApple Vision
Cloudflare Workers
Durable Objects
D1
React
TypeScript
One person puts their card down for dinner, then spends the next few days asking everyone what they owe on Venmo. An even split is quick, but it rarely matches what each person ate.
splitlobby settles it while everyone is still at the table. The host scans the receipt, sends one link to the table, and everyone taps what they ate. Shared dishes re-split live, and the whole check adds up to the exact cent so nobody at the table can argue with the numbers.



Nobody else has to download an app or make an account. They open the link and see the receipt right away. It only asks for their name when they tap their first item.
Because friends open that page from a group chat on restaurant wifi, the build enforces a 60KB size budget. I tried React 19 and had to revert it since it wouldn't fit.
Every recording here is the real stack running locally. You're watching Maya's phone, and Jo and Theo are two more phones at the table.
Reading the receipt
The iPhone app has no home screen and opens straight to the camera. I skipped Apple's stock document scanner because you can't style its controls and it's the first thing a host sees.
All of the reading runs on the phone with Apple's Vision. I turned language correction off since it tries to "fix" prices and a receipt isn't prose. The parser reads each price from the right end of a line and handles the misreads real paper produces, like SUBT0TAL, T0TAL and T1P.


On iOS 26, an on-device model also checks the parse and fixes items the rules split wrong. If it's slow or its answer fails a sanity check, the app falls back to the rules.
Next, the app verifies the sums before letting the host open the lobby. The items have to add up to the subtotal, and subtotal, tax and tip have to add up to the printed total. When a check fails, the app offers one-tap fixes like moving the decimal on the one line that closes the gap. Only the numbers go to the server, never the photo.
Splitting the cents
You don't know what a shared dish costs per person until everyone who shared it has claimed it. Here, Maya taps the guac after Jo, and then Theo taps it on his own phone.
The line goes from ÷2 to ÷3 on its own, and Maya's share counts down without her touching anything.
Every cent split anywhere in the product goes through one function. All money is whole cents with no floats. Everyone gets their exact share rounded down, and the leftover cents go out one at a time, largest remainder first. Nobody gets charged a third of a cent, so someone pays one cent more.


When remainders tie, the extra cent goes to whoever joined the lobby first, which keeps the order the same on every device. Splitting $8.75 three ways gives $2.92, $2.92 and $2.91. The line shows your exact share if you claimed it, and the range if you didn't.

Tax and tip go through the same function, weighted by what each person ate. Maya pays $14.68, Jo pays $33.31 and Theo pays $15.31, which adds up to the $63.30 on the receipt.
After every split, the function checks that all shares plus anything unclaimed still equal the total, and throws if they don't. Tests run it on thousands of random receipts, including discounts and zero totals.1
Live totals
Since the lobby is live, every number in it is a preview, and it should match what you'll owe at lock. The first version spread the whole tax across whatever was claimed so far, so the first people in carried all of it and watched their numbers drop as friends joined. Now an early claimant sees what they'll actually owe at lock.


While the lobby is open, tax only applies to the claimed part of the receipt. When Maya taps her tacos first, the old rule put the whole $4.20 tax on her. Under the current rule, she sees 72 cents right away, which is the exact share of tax her tacos carry at lock.2
Once everything is claimed, the preview and the locked check give the same result. Locking doesn't change the math. It just freezes the input. The server decides every number, and the guest page runs the same math locally just to show your tap before the server answers.
Sync and states
The backend is one Cloudflare Worker with one Durable Object per lobby. Because a Durable Object handles one request at a time, two people tapping the same taco in the same millisecond run in order, with the second request seeing the first claim. There are no locks or retries because the race can't happen.


Every update the lobby sends out carries the full state, including the item's whole claimant list and everyone's shares. Phones replace their state instead of adding or subtracting, and a phone that misses an update fetches a fresh copy.3 The lobby's address comes from a key the phone sends when it creates the lobby, so a host who retries on bad wifi lands in the same lobby instead of creating a second one.
Every lobby is open, in last call or locked.


Last call gives the table 60 seconds and drops a black countdown bar over the receipt.
When time runs out, any unclaimed line gets split across everyone and the lobby locks. A guest who shows up after that can knock to ask the host to reopen it.
Locking the check
Pending numbers are grey and locked numbers are black, so a screenshot can't look final before it is. On day one I tried putting a tilde in front of numbers that could still change, then cut it right away because it just read as noise.


Since color is the only thing that changes when the host locks, repainting the whole screen at once looked like a glitch. Instead, the shares turn black one line at a time from top to bottom, with your own number going last since it's the one you care about. Right after that, the receipt prints.
The paper feeds out at a steady speed and tears, and only the stamp bounces. Springs make sense for physical motion, while fixed timing fits mechanical motion since printers don't spring.
The hotel theme
The design started around a hotel lobby that prints receipts. Guests arrive, there's a last call, and if you're late you knock. When I couldn't draw a feature as something that happens to a receipt, I redesigned the feature. The mascot was an ink-drawn doorman, and his gloved hand holding a tray and a brass bell is still the app icon.


Entering a lobby rang a bell, capped at five times a minute so a busy table wouldn't sound like a slot machine. The first App Store set went all in on the theme, with brass gradients and the line "the math settles itself".


Then I put the app next to apps people actually trust with money, like Cash App, Venmo and Monzo. The brass banner turned into a plain ink bar, and I moved the stamp off the totals.




Today the App Store screenshots are just the plain receipt with nothing framed around it.

The same toning down happened with the copy. Early on, the doorman talked in lowercase everywhere, asking "who should I say is joining?" and calling your total "your damage". When I built the Mac app, I wrote plain copy rules for it using sentence case, direct words and no subtitles that repeat their title. I ran those rules across the whole product and dropped the doorman's voice.


I kept the hotel nouns like lobby, last call and knock, and moved the personality to the bottom of the receipt where it can't touch a number. The app picks a line when the lobby opens and prints it at lock, so Maya's table got "THE MATH CHECKS OUT. THE CALAMARI WAS A GROUP DECISION."
Past checks go into a stack. Each receipt gets a slight tilt from its ID, so the pile looks tossed without ever reshuffling. Over 30 days they fade like thermal paper, and then the server archives the lobby.

The Mac app
splitlobby also has a Mac app. Basically, the phone is for the night out and the Mac is for the night audit. The phone handles a sixty-second split with a bunch of people at once, while the Mac is a quiet archive that goes back years. You can drop any receipt onto it to run the same parser, and every lobby you hosted shows up with who had what.

Receipts are real .receipt packages on disk, and the database is just an index that a rescan rebuilds. Even if the app goes away, the archive is still a folder you can open.
Parsing follows the same setup as the phone, where a model proposes the lines and deterministic code checks every proposal against the sum check. When you expense a dinner you split, it files your share instead of the whole bill.
- Amount × weight can pass 2^53, so the multiplication happens in BigInt. Discount lines are negative, and splitting one mirrors the positive case, so −5¢ with weights 1 and 2 gives −2 and −3 instead of −1 and −4. ↩
- The live tax is round_half_even(tax × claimed ÷ subtotal). With $8.50 of the $49.25 subtotal claimed, that's 420 × 850 ÷ 4925 = 72.49, so 72 cents. ↩
- Each update has a version number, and a gap triggers the fetch. Device IDs only go up to the server, so a lurker can't collect them from any broadcast. ↩