portfolio
← PROJECTS
Screenshot of Medway Healthcare
Web · 2021

Medway Healthcare

A feature-rich OPD management system built for a private hospital in Sri Lanka, covering outpatient, laboratory, and pharmacy workflows.

NextJsFirebaseTailwind

Medway Healthcare is a full-stack OPD (Outpatient Department) management system I built for a private hospital in Sri Lanka. The goal was to digitise and streamline the day-to-day clinical and administrative workflows that were previously handled manually.

What it does

The system covers three core departments:

  • OPD Management — Patient registration, appointment scheduling, queue management, and doctor consultation records. Staff can track which patients are waiting, in consultation, or discharged at a glance.
  • Laboratory — Lab test orders flow directly from the OPD to the lab module. Results are entered digitally and linked back to the patient record, eliminating paper-based handoffs.
  • Pharmacy Inventory — Tracks medicine stock levels, processes prescriptions generated from consultations, and alerts staff when items fall below reorder thresholds.

Tech stack

The frontend was built with Next.js and Tailwind CSS, giving the UI a clean, responsive layout that works on both desktop workstations and tablet screens used by nurses at the counter.

Firebase powers the backend: Firestore for real-time data sync (so the queue board updates live without refreshing), Firebase Auth for role-based access (doctors, nurses, lab techs, pharmacists all have different views), and Firebase Storage for any documents or reports.

What I learned

This was one of my most complex full-stack builds at the time. The biggest challenge was modelling the data relationships — a single patient visit touches the OPD, lab, and pharmacy records, and all of it needs to stay in sync in real time. Firestore’s document model required careful denormalisation to avoid expensive reads.

Role-based access was also non-trivial. Different staff members need to see different parts of the system, and some data (like prescription details) needed to be readable by the pharmacy but not editable. Firebase Security Rules handled most of this, but it required thorough testing to get right.