Age Medical
Team · Freelance
From booked appointment to issued invoice.
A connected clinic platform — patient portal plus doctor and admin apps for scheduling, invoicing, reports and chat — built with a team of six.
I built the scheduling API client, the paid booking → invoice bridge with an idempotent per-booking ledger, the session, role and ownership guard layer in front of the API, unified notifications, and doctor–patient chat with read receipts and attachments.
- Next.js 16
- TypeScript
- Neon Postgres
- Drizzle
- better-auth
- TanStack Query
- API routes behind one guard
- 78 / 83
- query for unread counts
- N+1 → 1
How it works
- bookingscheduling platform
- signed webhook
- reconcile pollmissed-webhook fallback
- appointment upsertPostgres
- notify patient + doctor
- mark paid
- invoice ledgerpending → created / failed
- invoice + PDF
- doctor / patient
- route guardsession · role · ownership
- participant check
- message storecursor paging
- unread countsone SQL aggregate
