Skip to content
AB
All projects

Project

Live, with users

SKDC Management System

Clinic operations PWA for a multi-doctor chamber: scheduling, live token queue, patient records and vitals, cash and UPI payments, revenue sharing, doctor settlements, dashboards and CSV, Excel and PDF reports. Passkeys, field-level financial privacy and self-hosted deployment.

  • TypeScript
  • React 19
  • Fastify 5
  • SQLite
  • Vite PWA
  • Dexie/IndexedDB
  • WebAuthn
  • Zod
  • Cloudflare Tunnel
  • systemd

Purpose

SKDC brings a multi-doctor chamber's scheduling, token queue, patients, payments, revenue sharing and settlements into one installable progressive web app, so that a booking, a payment and the matching finance entry are always consistent.

Highlights

  • About 11,000 lines of TypeScript across 58 source files
  • 47 API route handlers and a 12-table relational model
  • Integer-paise accounting with immutable fee snapshots
  • Cursor-based delta sync to an IndexedDB cache
  • 11 authentication and authorisation test scenarios passing

Front desk

  • Book a patient into a doctor's session and get the next token automatically; patients found by normalised Indian mobile number
  • Live queue: pending, in consultation, completed, cancelled and no-show, with one patient in consultation per session
  • Patient records with contact details, age, gender, address, weight and blood pressure; duplicate mobile identities prevented
  • Cash or UPI payment, taken immediately or later

Finance

  • Each paid consultation creates a finance entry, with fee, chamber share and doctor share snapshotted at booking time
  • Doctor shares set as a percentage or a fixed amount; settlements recorded with method, reference and who recorded them
  • Summaries of gross revenue, cash and UPI, chamber revenue, doctor payable, settled and outstanding, for any date range
  • Filtered ledgers exported as CSV, Excel and PDF

Capabilities

  • Doctor profiles and sessions across many dates, rooms and time ranges
  • Daily, weekly, monthly and year-to-date dashboards
  • Sign-in with a password or a passkey; sessions last at most 30 days and can be revoked
  • Responsive layout with mobile bottom navigation; installable PWA with update prompts and online/offline status

Governance & quality

  • Four roles; finance features and confidential share data limited to privileged roles
  • Confidential share fields stripped when objects are serialised, including in sync responses
  • scrypt password hashing, hashed session tokens, Secure HttpOnly SameSite cookies, login rate limit
  • Authentication events logged; an append-only change log records domain changes
  • Multi-step operations run in one transaction

Architecture & delivery

  • Monorepo: React PWA, Fastify API and a shared domain package
  • SQLite in WAL mode with online backups
  • Loopback-only binding behind Cloudflare Tunnel; low-privilege systemd service with sandboxing and restart on failure

Current stage & roadmap

  • Integration and browser end-to-end tests for booking, finance and settlement journeys
  • Numbered, reversible database migrations
  • Scheduled encrypted backups, automated restore drills and health alerts
  • CSRF protection and a formal security-header policy

Outcomes

  • Live and used by the chamber's staff
  • Production build and 11 authentication and authorisation test scenarios passing (verified 3 September 2026)

Skills demonstrated

  • Domain modelling
  • Financial accounting logic
  • Full-stack TypeScript
  • Passkey authentication
  • Field-level privacy
  • PWA and offline-ready sync
  • Self-hosted operations