Kinda HMS · v1.0
Eight roles. Seven zones. One hospital, wired end to end.
Patient intake through triage, the clinical record, ICD-11 diagnoses, lab orders, pharmacy dispensing, ward admissions, invoicing and the audit trail — each behind a role guard enforced twice, in the route layout and again on every API procedure.
From $99 · Commercial at $249 launch, $349 after · One payment · Perpetual licence
Specification
- Framework
- Next.js 16 · App Router
- Language
- TypeScript 5, strict
- Database
- PostgreSQL · Prisma 7
- Schema
- 36 models · 11 migrations
- API
- tRPC 11 · 9 procedure guards
- Identity
- Better Auth 1.5 · TOTP 2FA
- Surface
- 67 pages · 283 components
- Roles
- 8, each its own namespace
- Automated tests
- None — see below
- Licence
- Perpetual
01 — Screens
What you are actually buying
Every screenshot below is the running application against seeded data — no mockups, no renders.













02 — The difference
A lab worker cannot read a diagnosis.
Role separation is the product. Each of the eight roles gets its own route namespace, its own layout guard, its own sidebar and its own tRPC procedure guard — never a shared "is staff" check. Navigate straight to another role's URL and the server layout redirects you before anything renders.
A receptionist registers patients but never authors a record. A doctor orders the test; only the lab worker records its result. Only the pharmacist dispenses. Only the accountant invoices and takes payment. Only the admin reads the audit log. A patient sees their own records and nothing else.
The guards have names, and sensitive mutations take a role-specific one rather than a generic one: adminProcedure, clinicalProcedure, doctorProcedure, labWorkerProcedure, pharmacistProcedure, accountantProcedure, staffsOnlyProcedure, protectedProcedure, baseProcedure.
03 — Build order
One journey, six desks, no re-typing
The modules are not separate CRUD screens bolted together. Each step hands the next one its data.
Registration — receptionist
Demographics, emergency contacts and consent flags. The patient number is generated by a Postgres trigger in YYMM-NNNN form, so it cannot collide under concurrent inserts.
Appointment or walk-in — receptionist, patient
Booked against service and doctor availability, or opened directly as a walk-in visit. Patients can book their own from the self-service portal.
Visit and triage — nurse, doctor
A confirmed appointment becomes a visit with a queue number, care type and a status that moves through the care journey.
The record — doctor
Chief complaints, vitals, diagnoses against the live WHO ICD-11 API, procedures, prescriptions, allergies, vaccinations and file attachments — all scoped to that visit and preserved.
Lab and pharmacy — lab worker, pharmacist
Tests ordered in the record appear in the lab queue; prescriptions appear in the dispense queue. Dispensing marks the prescription and deducts stock in a single transaction.
Admission and billing — clinical, accountant
Ward and bed selection with live occupancy; discharge frees the bed atomically. Invoices draw line items from services and pharmacy items, and promote Pending → Partial → Paid as payments land.
04 — Stack
Current, boring, deliberate
Nothing exotic. Nothing added that a few lines of code could do. If you write Next.js today, you can read this on day one.
- Next.js 16
- React 19
- TypeScript 5
- tRPC 11
- TanStack Query 5
- Prisma 7
- PostgreSQL
- Better Auth 1.5
- Tailwind CSS v4
- shadcn/ui
- Zod 4
- React Hook Form
- TanStack Table 8
- Recharts
- React PDF Renderer
- Resend
- Cloudflare R2
- WHO ICD-11 API
05 — Evidence
Claims you can check before you pay
No testimonials here yet. Numbers instead — every one of them verifiable in the repository on day one.
Guarded twice, not once
Every role's routes sit behind a server layout that redirects before a single component renders, and every mutation behind a procedure guard that checks the role again on the server.
That is the part hospital software usually gets wrong late and expensively: a shared "is staff" check that quietly lets a pharmacist open a diagnosis. Here the separation is structural — you would have to delete a guard to break it.
On the demo data
The seed script fills patients, staff, departments, lab orders, pharmacy stock and historic visits.
Billing, admissions and the dispense queue start empty — you create those records as you click through, which is also how you learn the flows.
06 — Before you buy
What this does not include
Better you read it here than find it on day three.
Not included
- An automated test suite. There is no Vitest or Playwright setup in the repository. Verification today is the type checker, the linter and a clean production build.
- Any compliance certification. Not HIPAA, GDPR, ONC, MDR or FDA certified or validated. It is application code, not an accredited medical device.
- Insurance or claims processing. Billing covers invoices and payments, not payer claims.
- A native mobile app. Responsive web only.
- Telemedicine or video consultation.
You supply
- A PostgreSQL database — Neon, Supabase, RDS or your own server.
- A Cloudflare R2 bucket for medical attachments.
- A Resend account with a verified sending domain.
- ICD-11 API credentials, free from the WHO API portal.
- Google OAuth credentials for social sign-in.
- Your own security review before any real patient data goes near it.
07 — Licence
One payment. Yours permanently.
Pay once, get a GitHub invitation to the private repository, and keep the version you received for good. Build and deploy with it; don't sell the source itself.
Personal
$24.75$9975% off with 9JV8C1HE — first 100 buyers, ends soonOne developer · non-commercial
- Every file in the repository
- Learning, portfolio and private projects
- Read the modelling, run it locally, take it apart
- 12 months of updates
- Upgrade later by paying the difference
Standard
$62.25$24975% off with 9JV8C1HE — first 100 buyers, ends soonOne organisation · up to 3 developers
- Everything in Personal
- Modify, rebrand and deploy commercially
- Charge your own users
- Unlimited users and deployments within the organisation
- 12 months of updates
- Perpetual licence for what you receive
Agency
$1,200Client work · separate businesses
- Everything in Standard
- Unlimited client deployments
- Hand a finished system to a client
- No developer limit inside your company
- Priority support channel
- Source escrow on request
Personal is for learning and private work — it does not permit shipping to users or charging for what you build. Standard covers one organisation and its subsidiaries. Building it for several clients, each a separate business, needs Agency. No licence permits reselling or republishing the source itself as a template, starter kit or course.
08 — Questions
Before you decide
v1.0 — available now
Skip the eight months.
Role-separated hospital software is mostly a modelling problem, and the modelling is already done here — 36 tables, 25 enumerations and the guards that keep a pharmacist out of a diagnosis. Start from that instead of from an empty schema.