A mobile-first receipt splitter for Lebanon's dual-currency reality: scan a receipt, split it item by item, and share per-person totals in LBP and USD.
Live at spolio.net. No account needed.
- Scan. Take a photo of the receipt. The image is compressed in the browser, uploaded to Convex storage, and sent to Google Gemini for extraction. The image is deleted once extraction finishes.
- Review. The extracted line items, service charge, tax and printed totals are shown as an editable bill. Items are checked against the printed total, and the LBP/USD rate is derived from the receipt itself when it prints both totals.
- Split. Add people and assign individual units of each item to them, or share an item evenly. Service and tax are distributed proportionally.
- Share. Publish a live share link or QR code. Friends open it in the browser, join the table, claim their items, and see their totals in both currencies update in real time.
Each bill is one Convex document holding its metadata, line items and people;
claims live in their own table because they are the high-churn part of a live
split. Edits are local-first and saved with a debounced mutation, and every
open screen updates over the Convex WebSocket. See
docs/architecture-decision.md for the
reasoning.
- TanStack Start and TanStack Router for routes, SSR and the app shell
- TanStack Query with
@convex-dev/react-queryfor live Convex queries - Convex for the reactive backend, file storage and
extraction actions, with
convex-helpers,@convex-dev/action-retrierand@convex-dev/rate-limiter - Tailwind CSS v4, Base UI, shadcn and Motion for the UI
- Zod,
browser-image-compressionandqrcode.react - Sentry for error reporting (optional)
- Vite, deployed to Cloudflare Workers with Wrangler
- Vitest and
convex-testfor tests
Prerequisites:
- Node.js 22 or newer and pnpm
- A Convex account
- For receipt scanning: a Google Gemini API key and a Cloudflare AI Gateway (extraction requests are routed through the gateway). Manual bill entry works without these.
pnpm install
cp .env.local.example .env.local
# Log in to Convex, create a dev deployment and push the functions.
# This also writes the deployment URL into .env.local.
pnpm exec convex dev --once
# Configure extraction on the Convex deployment.
pnpm exec convex env set GEMINI_API_KEY <your-gemini-api-key>
pnpm exec convex env set CF_AIG_ACCOUNT_ID <your-cloudflare-account-id>
pnpm exec convex env set CF_AIG_GATEWAY <your-ai-gateway-name>
# Start the web app and the Convex dev watcher together.
pnpm devOptional Convex environment variables read by the backend:
GEMINI_MODEL: the Gemini model to use (defaults togemini-2.5-flash-lite).CF_AIG_TOKEN: use a key stored in the AI Gateway instead ofGEMINI_API_KEY.EXTRACTION_DISABLED: set to any value to turn off receipt extraction.
VITE_CLOUDFLARE_WEB_ANALYTICS_TOKEN and VITE_SENTRY_DSN in .env.local are
optional; leave them blank to disable those services.
| Script | What it does |
|---|---|
pnpm dev |
Pushes Convex functions once, then runs the Vite dev server and convex dev together |
pnpm dev:web |
Vite dev server only |
pnpm dev:db |
convex dev watcher only |
pnpm build |
Production Vite build, then tsc --noEmit |
pnpm preview |
Preview the production build locally |
pnpm test |
Run the Vitest suite (unit tests and Convex function tests) |
pnpm brand:export |
Regenerate brand assets from brand/ sources |
pnpm cf-typegen |
Generate Cloudflare Worker types with Wrangler |
pnpm deploy |
Build and deploy the web app to Cloudflare Workers |
brand/ Brand sources, logo kit and asset export notes
convex/ Backend: schema, bill functions, extraction pipeline
docs/ Design and architecture documents
public/ Static assets, icons and web manifest
scripts/ Brand asset export script
src/ Frontend app
test/ Vitest suites for src/lib and Convex functions
Inside src/:
routes/: thin TanStack Router file routes (landing/scan, review, split, summary, guest join, privacy, terms)components/features/: the user-facing pages for each step of the flowapi/: the only place the frontend references Convex functionshooks/: React hooks, includinguseBillEditor, the local-first editorlib/: framework-free logic (bill/,money/,format/,session/)
Inside convex/:
schema.ts: the source of truth for stored databills/host/andbills/guest/: the public API, split by callerbills/lib/: custom function builders and shared validatorsmodel/: plain TypeScript helpers called by the public functionsextraction/: the receipt image to JSON pipeline (prompt, provider call, action)
A good reading order is convex/schema.ts, src/lib/types.ts, src/api/,
src/hooks/useBillEditor.ts, then the feature pages and the matching Convex
functions. convex/README.md describes the backend
layout and conventions in detail.
- Deploy the backend:
pnpm exec convex deploy, and set the same Convex environment variables on the production deployment. - Set
VITE_CONVEX_URLto the production Convex URL for the build. - Deploy the frontend:
pnpm deploy, which builds and runswrangler deploy.
wrangler.jsonc contains the Worker name, Cloudflare account and custom domain
used by spolio.net. Replace them with your own before deploying a fork.
docs/receipt-splitter-build-spec.md: product logic, extraction pipeline, currency and split mathdocs/architecture-decision.md: how bills are stored and edited, and whydocs/ui-flow-vision.md: how the app should feeldocs/ux-flow-and-motion-plan.md: the continuous-surface flow and motion designdocs/realtime-validation.md: validation notes for shared live sessionsbrand/README.md: brand colors, motion and asset export
Issues and pull requests are welcome. Before opening a pull request, run
pnpm test and pnpm build (which also type-checks) and make sure both pass.
By contributing, you agree that your contributions are licensed under AGPL-3.0-only.
Copyright (C) 2026 Charbel Tannous. Licensed under the GNU AGPL v3.0 only; see LICENSE.
If you use or fork this project, please credit the original with a link to https://spolio.net. If you run a modified version as a network service, you must publish its source under the same license.
The Spolio name, logo and brand assets (brand/, public/brand-*, app icons
and favicons, og-image) are not licensed under the AGPL. Forks must use their
own name and branding.
Spolio started from the
TanStack Start Convex example (convex-trellaux)
by TanStack, licensed under the MIT License.



