
The problem
Freelancers and small businesses in Kenya juggle quotes, invoices, VAT, deposits and receipts across spreadsheets and WhatsApp — with no clean way to get paid or see what's outstanding.
My approach
I built TallyPay as a multi-tenant SaaS: every business gets an isolated workspace to run the full money cycle — quotation → invoice (deposit + balance + 16% VAT) → receipt — with clients, a catalogue, delivery notes, share/PDF links, M-Pesa collection and a money dashboard. A free/Pro white-label split and a cross-tenant admin console round it out.
How it's built
- Next.js 16 (App Router + Server Actions) on Cloudflare Workers via OpenNext.
- Cloudflare D1 (SQLite) + Drizzle ORM; better-auth multi-tenant orgs — every query scoped by requireOrg().
- Money as integer KES cents, VAT in basis points — unit-tested accounting.
- M-Pesa STK push (Kopo Kopo) with auto-receipting; per-vendor accounts encrypted at rest.
- A4 PDF share links (Cloudflare Browser Rendering), Resend email, admin console with KPIs + audit log.
Highlights
- True multi-tenant SaaS — isolated workspaces, free/Pro white-label, admin console.
- M-Pesa collection with automatic receipting and per-vendor payout accounts.
- Correct-by-design accounting — integer cents, basis-point VAT, unit-tested.