ADEXTECHHUB
HEALTHTECH · AI · SAAS

MedOS AI

Serverless-first AI-augmented hospital management system. Enforces RBAC at the middleware layer, includes an AI Triage Engine using the MEWS algorithm, and logs every write to an immutable audit trail.

Next.js 15TypeScriptSupabasePostgreSQLAIRBAC
LIVE DEMO ↗GITHUB ↗

THE PROBLEM

Hospital management systems are fragmented, paper-heavy, and lack real-time clinical decision support. Patient triage is often manual and delayed, creating risk in high-volume environments.

THE PRODUCT

MedOS AI is a serverless-first hospital management system built on Next.js 15 and Supabase. It enforces role-based access control at the middleware layer, includes a clinical AI Triage Engine built on the MEWS (Modified Early Warning Score) algorithm, and writes every mutation to an immutable audit trail for compliance and accountability.

ENGINEERING DECISIONS

  • 01

    Serverless-first with Next.js Server Actions for zero cold-start latency on core flows

  • 02

    RBAC enforced at the middleware layer, not just in UI — preventing unauthorized access at the routing level

  • 03

    MEWS algorithm chosen for clinical scoring: evidence-based, lightweight, auditable

  • 04

    Supabase for Realtime subscriptions on ward dashboards with row-level security

  • 05

    Immutable audit log implemented as append-only Postgres table with write-only service role

CHALLENGES

  • Implementing multi-tenant RBAC where staff roles differ per department (doctor, nurse, admin, ward manager) with correct data isolation

  • Making MEWS scoring deterministic and auditable — every score change must be traceable to source vitals

  • Designing an immutable audit trail that is performant under high write volume

  • Keeping the UI fast while subscribing to realtime ward updates across multiple concurrent users

RESULTS

  • Live demo deployed at medosapp.vercel.app with working authentication, RBAC, and triage flows

  • Immutable audit trail captures all write events with user, timestamp, and action metadata

  • MEWS engine produces clinical risk scores from vital sign inputs

WHAT I WOULD IMPROVE

  • Add a proper LLM layer to generate natural-language clinical summaries from MEWS scores

  • Implement lab result integration for richer clinical context

  • Add offline-capable PWA mode for wards with unreliable connectivity

  • Build proper multi-hospital tenancy with subdomain isolation

// ARCHITECTURE
MAIN FLOW
USER
NEXT.JS 15
AUTH / RBAC
API / SERVER ACTIONS
SUPABASE
POSTGRESQL
AI SERVICES
AUDIT TRAIL
AI SYSTEM
PATIENT DATA
AI TRIAGE
MODEL
CLINICAL OUTPUT