Skip to content

About

Splitwise-style group expense tracker. TypeScript monorepo: NestJS + Prisma + PostgreSQL, React + Vite + Tailwind/shadcn, Docker, GitHub Actions CI/CD

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Bill Splitter

A Splitwise-class group expense tracker — split bills, track who owes whom, settle up.

Stack: TypeScript end-to-end · pnpm + Turborepo monorepo · NestJS + Prisma + PostgreSQL · React + Vite + Tailwind + shadcn/ui · Docker Compose + Traefik on a VPS · GitHub Actions CI/CD.

Status: Phase 0–4 complete (skeleton, auth, groups, invites, expenses with all four split types, multi-payer UI with live preview). Phases 5–8 (balances, settle-up, multi-currency, Google OAuth, prod hardening) are scoped in the implementation plan. See MVP scope below.

Quickstart

Prereqs: Node 20+, pnpm 9+, Docker.

# 1. Install dependencies
pnpm install

# 2. Bring up Postgres
cp .env.example .env
docker compose -f infra/docker-compose.yml up -d postgres

# 3. Apply migrations & seed currencies
pnpm --filter @bill-splitter/api prisma:migrate:dev
pnpm --filter @bill-splitter/api seed

# 4. Start API + web
pnpm dev

Repository layout

apps/
  api/           NestJS + Prisma + Postgres
  web/           Vite + React + Tailwind + shadcn-style
packages/
  shared/        zod schemas + money math + simplify-debts algorithm (used by api & web)
  eslint-config/ flat ESLint config
  tsconfig/      base / node / react TS configs
infra/
  docker-compose.yml          local development
  docker-compose.prod.yml     prod overlay (Traefik, GHCR images, Let's Encrypt)
  deploy/deploy.sh            SSH deploy entrypoint
.github/workflows/
  ci.yml      · deploy.yml
docs/
  architecture.md
  adr/        Architecture Decision Records (MADR format)

Conventions

  • Money is always BigInt minor units (cents). Floats never appear. See packages/shared/src/money/.
  • Schemas (zod) live in packages/shared/src/schemas/ — single source of truth for validation on both API and web.
  • Conventional Commits are enforced by commitlint + Husky. PRs target main.
  • Tests — Vitest + fast-check for shared/, Jest + supertest for api/, Vitest + Testing Library for web/, Playwright for e2e.

MVP scope

  • Auth: email/password + JWT access (15m) + refresh-token-cookie (30d, rotated on refresh)
  • Groups + invite-by-link
  • Multi-member groups, owner permissions
  • Expenses backend supports all split rules (EQUAL / PERCENT / AMOUNT / SHARES) — Phase 3
  • Web: equal-split expense form + list + soft-delete — Phase 3
  • Web: SplitEditor (all 4 modes, live preview via shared computeShares) + multi-payer — Phase 4
  • Balances + settle-up suggestions (debt simplification) — Phase 5
  • Multi-currency with FX snapshot at expense time — Phase 6
  • Google OAuth — Phase 7
  • Production hardening: Traefik + Let's Encrypt, throttler, helmet, Sentry hook — Phase 8

The settle-up algorithm and money allocator are already implemented and property-tested in packages/shared/src/settle/ and packages/shared/src/money/ — they are wired in during Phase 5 and 4 respectively.

Documentation

License

MIT — see LICENSE.

About

Splitwise-style group expense tracker. TypeScript monorepo: NestJS + Prisma + PostgreSQL, React + Vite + Tailwind/shadcn, Docker, GitHub Actions CI/CD

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages