Skip to content
HANS VIDAURE

Side project

SliceOfPie

Split a restaurant bill from a photo of the receipt, fully offline in the browser.

Role
Solo: design, build and test
Two SliceOfPie screens: assigning receipt items to people, and the bill total with a pie chart of each share

Overview

SliceOfPie splits a bill by item or evenly. Scan the receipt with your phone: the text recognition runs in the browser and works offline. It installs like an app, with no accounts, no server and no tracking.

Problem

Every bill-splitting app I tried wanted everyone to sign up, needed a connection, or wanted my data. I wanted one that works at the table with no signal, from a photo of the receipt, and never sends that photo anywhere.

Outcome

I use SliceOfPie regularly when eating out with friends. It handles the math I used to do on a napkin, and nobody needs to download anything or make an account — I just scan the receipt and split.

From a photo to a split bill
ScannerChecks the photo for blur and lighting, then runs PaddleOCR on ONNX Runtime in a Web Worker
ParserTurns lines of text into items, prices, discounts and tax
The billYou assign the items. Shares are whole cents, saved on the phone in IndexedDB

Decisions

Key decisions

No framework. The app is small enough that a framework would add a virtual DOM and a state library to solve problems it doesn't have. Every screen re-renders through an explicit render function, so each state change is easy to trace, and startup stays at about 25 KB.

PaddleOCR instead of Tesseract. Tesseract.js got every price right on 4 of my 16 test receipts. PaddleOCR on ONNX Runtime, in a Web Worker, got 16 of 16. The cost was size, so the scanner asks before it downloads and is cached for offline use. Tesseract stays as a fallback for browsers that can't run it.

What was hard

Money that always adds up. Shares are worked out in whole cents and whoever paid takes the leftover cent, so $100 three ways is $33.33, $33.33 and $33.34. Everything rounds through one function, so 178.365 can't round two different ways.

A bug only a real iPhone showed. Installed on the Home Screen, the tab bar opened 60 points too high, which no browser or test could reproduce. The fix is confirmed working on a device; the field note covers how I found it.

Results

KEY NUMBERS

Lighthouse performance
99/100
Lighthouse accessibility
100/100
Receipts read right: PaddleOCR
16/16
Receipts read right: Tesseract.js
4/16

By the numbers

  • Lighthouse on mobile: 99 performance, 100 accessibility, 100 best practices, 100 SEO
  • 0 ms blocking time and no layout shift
  • About 25 KB of gzipped JavaScript at startup: a 23 KB app bundle plus a 2 KB service-worker helper
  • The 36 MB receipt scanner only downloads when you ask for it, then works offline
  • axe finds no accessibility issues on any screen, in light or dark mode
  • ~165 unit tests and 42 end-to-end tests, each run on phone and desktop, on every push
  • No framework: about 4,900 lines of TypeScript across 49 modules

Built with

Vite 8, TypeScript, Workbox service worker, PaddleOCR (PP-OCRv5) on ONNX Runtime Web, IndexedDB, Vitest, Playwright + axe-core, Lighthouse CI on GitHub Actions, strict Content-Security-Policy.