All Case Studies
Multi-Tenant SaaS Platform

Care Hub

A resident-centred operating system for UK CQC-regulated care homes

Care home compliance isn't 11 frameworks — it's 21 entities, 17 migrations, eMAR with dual-sign controlled drugs, NEWS2 auto-escalation, CQC KLOE evidence on every action, and HACCP/Legionella/COSHH/Fire on top. Built to the same RLS-first standard as Compliance Hub, tailored for CQC.

62Tables
17Migrations
5,000+Demo seed rows
8Roles
0Security advisor lints
Care Hub

The Brief

A UK CQC-regulated residential and nursing home running on paper MAR charts, paper handover, paper everything — needing to digitise care plans, medications, incidents, safeguarding, training, audits, meals & nutrition, activities, rota, and CQC KLOE evidence into one system. Built to the same architecture standard as Compliance Hub, with the same RLS-first, RAG-as-data, audit-by-default principles, but tailored for the regulatory regime that actually matters to a care home: CQC Key Lines of Enquiry across Safe, Effective, Caring, Responsive, and Well-led.

The Schema — 21 Industry Entities, 17 Migrations

0001 core — organizations, profiles, sites (care homes), memberships, audit_log, RAG helpers, RLS predicates, bootstrap-first-super trigger 0002 residents — residents, care_plans, risk_assessments with RAG triggers (resident RAG = worst of care plan due / DoLS expiry / risk level) 0003 medications — medications, mar_entries (MAR chart), controlled_drugs_register (dual-signature enforced via DB constraint) 0004 incidents — incidents, safeguarding_alerts, body_maps, body_map_marks 0005 staff — staff_records, training_courses, training_records, supervision_logs, appraisals (staff RAG = worst of DBS / RtW / mandatory training) 0006 compliance — compliance_documents, audits, maintenance_assets (with LOLER on hoists), maintenance_jobs 0007 meals — dietary_profiles (IDDSI / MUST), menu_plans, meal_choices, meal_intake (quartile), weight_records (auto BMI), kitchen_audits 0008 daily logs — daily_logs, news2_observations, abc_charts, activities, activity_participation, handover_notes, visitors, family_communications 0009 governance — complaints (28d RAG cycle), best_interests_decisions, advance_care_plans (ReSPECT), pre_admission_assessments, kloe_tags 0010 rota — shifts, shift_assignments, time_off, agency_bookings, v_shift_fill view, v_staff_weekly_hours view (WTD) 0011 gp_connect — gp_visits, hospital_admissions, fhir_payloads 0012 storage — 5 private buckets (care-hub-docs, resident-photos, body-maps, evidence, menu-images), org-scoped policies via storage_path_org() 0013 security — view security_invoker, function search_path pinning, WITH CHECK tightening 0014 revoke_public — revokes anon/authenticated EXECUTE on RLS helpers 0015 haccp — appliances, twice-daily temperature logs (auto in_range trigger), supplier deliveries, cleaning schedule 0016 coshh — substances register (CLP signal + GHS pictograms + SDS), per-task assessments with controls/PPE/first-aid + RAG 0017 legionella — ACOP L8 / HSG274: outlets, monthly temp checks (auto in_range: hot ≥ 50°C / cold ≤ 20°C), weekly flushing, quarterly descales, structured L8 RAs 62 tables. 54 enums. 2 views. Security advisor: 0 lints.

eMAR with Controlled Drugs

mar_entries is the digital Medication Administration Record. Each entry stores resident_id, medication_id, administered_at, administered_by, dose, route, witness_id (NULL for non-CD), reason_not_given. RAG triggers compute the medication's status per resident — green if administered on time, amber if approaching window close, red if missed. For controlled drugs, the dual-signature requirement is enforced at the database level: CHECK (witness_id IS NOT NULL AND witness_id <> signed_by) You cannot insert a controlled_drugs_register entry where the witness is the same as the signer, and you cannot insert one without a witness at all. Application logic can be wrong; the database constraint cannot.

NEWS2 Vitals With Auto-Escalation

news2_observations stores RR, SpO2, scale, temp, BP, HR, consciousness. A SQL function computes the NEWS2 aggregate score per row. RAG status is derived: 0-4 = green, 5-6 (or any single param = 3) = amber, ≥7 = red. The dashboard surfaces every red NEWS2 observation in the last 24h as "residents needing attention" — the floor manager sees the deterioration before they walk into the room.

CQC KLOE Evidence

Every operational record can be tagged with a kloe_tags row pointing at one of the five Key Lines of Enquiry: Safe, Effective, Caring, Responsive, Well-led. /reports/kloe surfaces a filtered evidence list per domain. When CQC inspectors arrive and ask for evidence under "Safe", the system produces it — incidents with corrective actions, body maps with documented mitigations, controlled drug registers with dual signatures, training matrix with current DBS and RtW. Spreadsheet evidence is a guess. This is defensible.

Roles — Eight, Granular

super_admin — JonnyAI ops, cross-org registered_manager — org-wide, full access, DoLS sign-off deputy_manager — org-wide, no DoLS nurse — clinical: meds, vitals, care plan, IBD, ACP senior_carer — med admin within scope, daily logs, incidents carer — daily logs, incidents (no med admin) support_staff — kitchen / domestic, limited family_viewer — single resident, read-only profiles.is_super_admin (boolean) is the real super-admin gate. RLS predicates: is_super_admin(), is_org_member(), is_site_member(), is_clinical(). Every policy uses them — no hand-rolled membership lookups in policy bodies.

Real Demo Data — Manor House

The live database is seeded with a real care home's HACCP dataset (Manor Barn). Generated from Manor Barn HACCP Sheet.xlsx by scripts/generate-manor-barn-seed.py and loaded by chained seed scripts. 27 residents · 4,295 temperature logs · 155 supplier deliveries · 206 cleaning schedule rows · 246 menu plans · 60 medications · 142 MAR entries · 60 daily logs · 40 NEWS2 observations · 5 staff · 25 shifts · 3 controlled drug entries · 5 KLOE evidence tags · plus advance care plans, best-interests decisions, ABC charts, COSHH assessments, water outlet temp checks, fire drill records, supervision logs, appraisals. A prospective buyer logs in and sees a working care home, not a clean slate.

The Outcome

Live at care-hub.jonnyai.co.uk on a GCP VM. Demo: demo@jonnyai.co.uk / Demo2026!! Strict CI: tsc --noEmit, next lint, next build — all hard gates. 22 application pages from /residents through /coshh to /reports/kloe. Mobile responsive with body-map UI in roadmap. Sage primary #4A7C59 · warm gold #D4A574 · cream surface #FAF8F4 · forest text #2C3E2D — calm clinical palette, dark mode supported. Sold as a SaaS: £99/mo Starter (1 home, up to 5 staff users), £299/mo Pro (up to 5 homes, 25 users), £999/mo + £1,500 setup white-label for groups that need their own brand.

Ready to build something real?

Not a chatbot. Not a proof-of-concept. Production AI infrastructure that runs inside your business and does the work.