notajson.dev
← All projects
live2025 · mobile-first web app · side project

Zpend

The app my friends and I used to split expenses kept its full features behind a subscription, so I built my own. Made for the phone: add an expense at the table, split it equally or by hand, and see who owes whom update live for everyone in the group. Built on React 19 and Supabase.

// snapshots

Made for the phone in your hand at the restaurant.

7 / 7 screenshots · zpend.vercel.app at 390 wide · names changed, bank QR pixelated

// try it

The balance math, running on a sample trip.

The same functions the app uses: splitEqual, the net per person, and the list of who pays whom. Turn expenses on and off, then settle up.

Beach trip · 4 people₱15,650.75

net per person · + gets money back, − owes

You+₱5,003.97
Mia−₱1,211.94
Leo−₱2,996.02
Kai−₱796.01
settle up · 3 transfers
Leo → You₱2,996.02
Mia → You₱1,211.94
Kai → You₱796.01

// stack

What it's built with, and where each piece runs.

8 technologies · tap one to see where it runs

app/TypeScript
  • React 19Every screen, with one hook per job: useGroupData, useExpenseForm, useMemberLabel
  • TypeScript 5.9App and API layer; tsc -b runs clean
  • MUI 7Components and theme: flat, no shadows, bottom sheets and a bottom nav
  • React Router 7Routes behind auth guards; /invite/:token opens straight from a link
  • Vite 7Dev server and production build
backend/Supabase
  • Supabase AuthSign in with email or username; email confirmation keeps a pending invite
  • Postgres + RPCGroups, expenses, splits, payments; functions create groups and accept invites
  • RealtimeSeven tables push changes to every open group screen
  • StorageQR codes for each member's payment methods
host/Vercel
  • VercelStatic deploy; a rewrite lets /invite links load the app directly

Logos: Simple Icons (CC0). Trademarks belong to their owners.

// how it works

A React front end over one Supabase project.

No server of my own. Each feature maps to one Supabase piece, and every group screen listens for changes, so everyone looking at the same group sees the same numbers.

FeatureRuns onHow
Sign inAuthEmail or username. A username is looked up to its email by a database function, so the client never lists users.
GroupsPostgres · RPCOne function call creates the group and makes you its owner, so a group never exists without one.
InvitesRPC · tokensEmail invites, or a public link that works many times and can be revoked. The token is kept through sign-up and email confirmation.
ExpensesPostgresEqual or custom splits. Each share is a row, and marking it paid adds a payment row.
Live updatesRealtimeGroups, members, invites, expenses, splits, payments and hidden groups stream changes; screens refresh without a reload.
Payment methodsStorageMembers upload a bank or e-wallet QR; whoever owes can view and download it.

// decisions

Three calls worth explaining.

01

No centavo goes missing

splitEqual rounds every share down to the centavo and hands the leftovers to the first members, one each. ₱1,000 for three is 333.34 + 333.33 + 333.33, which adds back to exactly ₱1,000.

02

Settling marks shares paid

Settling up doesn't add a separate transfer to the balance math. It marks the matching shares paid, so the same money is never counted twice.

03

Live by default

Every group screen subscribes to Supabase Realtime. Add an expense on one phone and everyone else in the group sees the new balance without a refresh.

// checks

What's verified, and what isn't yet.

Run on the last commit. The lint failures are real and still open.

zpend · main
Queued: $ npx tsc -b
Queued: $ vite build
Queued: $ deploy to Vercel
Queued: $ npx eslint .
Queued: $ unit tests (splitEqual, balances)

queued · 5 checks

// next

What's left, in order.

  1. ◐ in progressFriendsAdd people once, then invite them to any group from your list. Built locally, not deployed yet.
  2. ○ thenTests for the money mathsplitEqual and the balance functions are pure, so they are the easiest place to start.
  3. ○ thenClear the lint errorsMove the setState calls out of effects and fix the rest of the 8.
  4. ○ thenSplit the bundleLoad each route on demand instead of one 865 kB file.
  5. ○ laterNative appRebuild it with Expo and React Native, the same setup as TV Remote, on the same Supabase backend and split math. The web app stays live.