Healthcare · Hospital Operations · Raebareli, Uttar Pradesh
Aarogya Patient Management — Automated Hospital CRM
How we engineered a secure patient intake, automated OPD doctor scheduling, and real-time queue tracker using Next.js and Better-Auth.
- Client
- Aarogya Hospital
- Duration
- 5 weeks build · active deployment
- Live
- Visit site
- Updated
- 2026-06-24

Highlights
5,000+
Patients registered
40%
Wait time reduction
100%
Secure role access
Situation
Aarogya Hospital, a leading multispecialty healthcare provider in Raebareli, manages hundreds of daily outpatient department (OPD) walk-ins. Despite having a modern information website, the hospital's internal registration and record-keeping systems remained largely paper-based or local to individual clinic desktops.
This manual system created several operational bottlenecks:
- Lobby congestion: Patients had to stand in long physical queues at the main lobby desk for registration, doctor assignment, and OPD tokens.
- Scattered medical histories: Doctor prescriptions, lab reports, and billing slips were handed out on paper, making it difficult to reconstruct a patient's historical treatment records when they visited a different department.
- Staff workload pressure: Receptionists spent excessive time manually copying patient details into independent billing and appointment ledgers.
To solve this, the hospital required a unified, secure web application—a patient portal and CRM—to handle intake, queue management, electronic health records (EHR), and prescription dispatches.
Task
The Vellumarc team was engaged to design and develop the Aarogya Patient Management system (Aarogya PM) with four primary goals:
- Secure Access Controls: A robust role-based authentication layer (Admin, Doctor, Staff, Patient) to protect sensitive healthcare data under Indian digital personal data protection principles.
- Automated Queue Management: An internal ticketing and OPD queue system that allows receptionists to register patients and instantly place them in a digital, real-time queue for their assigned doctor.
- Electronic Health Records (EHR): A central repository where doctors can input symptoms, diagnoses, prescriptions, and view historical visit timelines.
- Intuitive Dashboards: Tailored interfaces matching the specific workflows of desk staff (fast intake), doctors (clinical timelines and prescription pad), and patients (viewing active tokens and histories).
Action — Architecting Role-Based Portals with Better-Auth
Security is paramount in healthcare applications. We integrated Better-Auth as our authentication engine due to its developer-friendly API and secure defaults:
- Role-Based Access Control (RBAC): We defined custom session claims using MongoDB to store user roles. This ensures doctors cannot access overall hospital financial records, billing staff cannot edit clinical notes, and patients can only access their own history.
- Two-Factor Login: Implemented email/password authentication backed by one-time password (OTP) verification for admin and doctor logins to prevent unauthorized access.
- Session Management: Set up short-lived access tokens with secure HTTP-only cookies, safeguarding patient records against cross-site scripting (XSS) and session hijacking.
Action — OPD Queue Automation
To solve lobby congestion, we engineered a reactive OPD Queue System. The workflow flows smoothly:
- Intake: The receptionist registers a new patient in under 60 seconds or pulls up an existing record using their phone number or ABHA ID.
- Doctor Assignment: The receptionist selects the consulting doctor and clinical department.
- OPD Token Generation: The system generates a digital token and adds the patient to the doctor's live queue list.
- Live Monitor Display: A TV screen dashboard in the waiting lobby displays the token numbers currently being called by each doctor, letting patients track their turn without crowding the corridors.
- Doctor's Prescription Pad: The doctor logs into their portal, sees the next patient in the queue, pulls up their EHR file, inputs clinical notes, and prints a formatted digital prescription. Clicking "Complete" automatically prompts the queue screen to call the next token.
Key Technical Decisions
- Next.js Server Components & Turbopack: Next.js was selected to run heavy database queries for EHR timelines directly on the server, returning optimized HTML to ensure responsiveness on low-cost tablet devices used by clinical staff.
- MongoDB with Mongoose ORM: To manage scalable document structures for patient records, OPD logs, clinical histories, and billing data.
- Better-Auth Integration: Simplifies authorization logic across Next.js API endpoints and layouts, reducing security boilerplate.
- Tailwind CSS: Enabled us to create a high-contrast dashboard interface optimized for healthcare settings with large typography, comfortable hit targets, and clean spacing.
Results
Since the launch of the Aarogya Patient Management system:
- Over 5,000 patients registered and tracked in the digital EHR system.
- 40% reduction in lobby wait times, with patients tracking their token status from waiting room monitors or their own phones.
- 100% role-based security compliance, keeping health information private and auditable.
- Zero paper prescription loss, with doctors printing digital cards and patient files syncing instantly across departments.
Ready to optimize your operations?
If you manage a clinic, diagnostics lab, or multispecialty hospital and need to replace manual spreadsheets with a high-performance, secure patient portal and CRM, we can build it. Contact us to scope your healthcare dashboard today.
“Implementing the Aarogya Patient Management platform has completely transformed our morning lobby rush. Patient queue wait times dropped by 40% in the first month, and having instant access to unified digital records has made our doctors far more efficient.”