Case Study: How We Built a Hospital Management System for a 120-Bed Hospital in Ibadan
## The Project In Q3 2025, a private healthcare group in Ibadan approached Neobot Tech with a challenge that many Nigerian hospitals face: their entire patient...
The Project
In Q3 2025, a private healthcare group in Ibadan approached Neobot Tech with a challenge that many Nigerian hospitals face: their entire patient record system was paper-based. Appointment booking happened via phone calls logged in a physical register. Pharmacy inventory was tracked in notebooks. Billing was done in Excel.
They needed a modern, integrated hospital management system — built for the realities of Nigerian healthcare: unreliable power, variable internet connectivity, and staff with varying technical literacy.
Requirements
After a 3-week discovery phase, we defined the core modules:
- Patient Registration & Records: Electronic patient files with visit history
- Appointment Scheduling: Multi-doctor, multi-department calendar system
- Pharmacy Management: Drug inventory, dispensing records, reorder alerts
- Billing & Payments: Paystack integration, receipt generation, insurance tracking
- Laboratory Module: Test request, result entry, and patient notification
- Staff Management: Attendance, roles, access controls
- Offline Support: Critical modules (patient registration, billing) must work during internet outages
Technical Architecture
Frontend: Next.js 15 (App Router) + TypeScript + TailwindCSS
Backend: Node.js API + Prisma ORM + PostgreSQL 16
Auth: Custom JWT with role-based access control (RBAC)
Offline: IndexedDB (Dexie.js) + background sync via Service Workers
Payments: Paystack (inline + transfers)
Hosting: Self-hosted on VMware VPS, Nginx reverse proxy
Backup: Automated daily pg_dump to Google Cloud Storage
Key Challenges & Solutions
Challenge 1: Offline-First for Critical Modules
The hospital sometimes experienced 2–4 hour internet outages. We implemented an offline-first architecture using Dexie.js (IndexedDB) for patient registration and billing. When connectivity was restored, the system automatically synced pending records to PostgreSQL.
Challenge 2: Multi-Role Access Control
The system needed to work for doctors, nurses, pharmacists, lab technicians, receptionists, and admin — each with different permissions. We implemented a custom RBAC middleware in Next.js middleware.ts that checked JWT claims on every API route.
Challenge 3: Pharmacy Drug Search Performance
With 2,000+ drug entries, the pharmacy search needed to be instant. We added a PostgreSQL full-text search index on drug names and generic names, reducing search latency from ~400ms to ~15ms.
Results (3 Months Post-Launch)
- Administrative overhead reduced by 60% — same staff now process 40% more patients
- Zero lost patient records (previously, paper records were regularly misplaced)
- Billing accuracy improved — manual billing errors dropped from ~12% to <1%
- Pharmacy stockouts reduced by 70% due to automated reorder alerts
- Staff satisfaction score: 4.6/5 in post-launch survey
Lessons Learned
- Invest heavily in offline support for Nigerian enterprise apps — internet reliability cannot be assumed
- Role-based access control must be designed upfront — retrofitting it is painful and insecure
- Training is part of delivery — we spent 2 weeks training 45+ staff members; this is non-negotiable
- Simplify the UI — healthcare staff are not tech-savvy; prioritize clarity over aesthetics
Building a similar system for a school, hospital, or government institution? Explore our enterprise software development services or contact us directly to discuss your requirements — we're based in Ibadan and Lagos.
If you're building a healthcare, school, or institutional management system in Nigeria, reach us at hello@neobottech.org.
Neobot Engineering Standard
Every system deployed by Neobot Tech incorporates enterprise baseline practices. We continuously audit our database topologies, REST API query paths, and frontend modular bundles to prevent latency spikes and ensure top-tier security posture.
Discussion
Comments Coming Soon
We are currently migrating our discussion engine to a new real-time database schema. Check back shortly to join the conversation.