Skip to content
 
 

Repository files navigation

Owes Tracker

A fast, mobile-first personal tracker for who owes you money, how much, why, and whether they've paid. Built with Next.js (App Router) + Supabase, deployed on Vercel, installable on iPhone as a PWA.

How it works

  • PIN lock — the app is gated behind a PIN. Data is fetched server-side only using the Supabase service_role key, so the browser can never hit the database directly. The PIN unlocks a signed, httpOnly session cookie.
  • Supabase — data lives in two tables in the shared body-coach project: owe_people and owe_transactions (RLS on, no public policies — only the server can read/write).
  • Amounts can be negative — use the − toggle for adjustments / partial repayments.
  • Paid vs Pending — marking paid removes it from outstanding totals but keeps the full history.

Environment variables

Set these in .env.local (local dev) and in Vercel → Project → Settings → Environment Variables:

Variable What
SUPABASE_URL https://glmuhwqacdvzpoismpol.supabase.co
SUPABASE_SERVICE_ROLE_KEY Supabase → body-coach → Settings → API → service_role (secret)
APP_PIN The PIN you type to unlock (e.g. 4271)
SESSION_SECRET Long random string. Generate: node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"

Run locally

npm install
npm run dev
# open http://localhost:3000

Deploy to Vercel

  1. Push this folder to a GitHub repo (or use vercel CLI).
  2. In Vercel: New Project → import the repo.
  3. Add the 4 environment variables above (Production + Preview).
  4. Deploy. Vercel auto-detects Next.js.

Using the Vercel CLI instead

npm i -g vercel
vercel            # link + first deploy (preview)
vercel --prod     # production deploy

Add env vars with vercel env add SUPABASE_SERVICE_ROLE_KEY, etc., or in the dashboard.

Add to iPhone home screen

  1. Open your Vercel URL in Safari on the iPhone.
  2. Tap the Share button → Add to Home Screen.
  3. Launch it from the icon — it opens full-screen like a native app.

Database schema

See the owe_tracker_init migration. Tables:

  • owe_people(id, name, created_at) — unique on lower(name).
  • owe_transactions(id, person_id, amount, description, note, txn_date, status, created_at) — status is pending | paid; amount may be negative.

About

Mobile-first personal owes tracker (Next.js + Supabase), PIN-gated, iOS-style UI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages