A consolidated MERN-stack reference implementation and development plan for a Smart Health Care System designed for urban hospitals. The system focuses on reducing wait times and improving coordination between departments by providing a single platform for appointments, triage/admission, laboratory orders/results, and e-prescription + pharmacy workflows.
The repository contains a prescriptive implementation blueprint in AGENTS.md intended for an automated coding agent (Copilot) or developers to implement the project end-to-end.
Note: For high-level domain context, an attached project brief was used during scoping. All technical implementation details are self-contained in AGENTS.md.
- AGENTS — authoritative, self-contained spec and implementation plan (models, API, frontend, tasks)
- CODE_OF_CONDUCT — Code of conduct
- CONTRIBUTING — Contributing guidelines
- SECURITY POLICY — Security policy
Goals:
- Allow patients to register, book and manage appointments.
- Support nurse triage, severity assessment, and bed management.
- Enable doctors to order lab tests and create e-prescriptions.
- Provide lab technicians and pharmacists with dedicated dashboards for processing orders and dispensing medication.
Primary user roles:
- Patient
- Doctor
- Nurse (Triage)
- Lab Technician
- Pharmacist
- Staff (administrative)
Core features:
- Appointment booking and management
- Triage records and bed assignment
- Lab test ordering and results management
- E-prescription creation, validation, and dispensing
- Frontend: React (recommended with react-router-dom)
- Backend: Node.js + Express
- Database: MongoDB (Mongoose)
- Authentication: JWT
- HTTP client: Axios (frontend)
- /server — backend server (Express + Mongoose)
- /client — React front-end
AGENTS.md— comprehensive spec, tasks, and implementation planREADME.md— this document
The complete, production-ready backend server is now implemented in the server folder.
Backend Features:
- ✅ Full authentication & authorization with JWT
- ✅ Role-based access control (Patient, Doctor, Nurse, LabTechnician, Pharmacist, Staff, Admin)
- ✅ Complete CRUD operations for all modules
- ✅ Appointments management system
- ✅ Triage & bed management
- ✅ Lab order & results system
- ✅ E-prescription & pharmacy dispensing
- ✅ PayPal Sandbox payment integration
- ✅ Input validation & error handling
- ✅ MongoDB database with Mongoose ODM
- ✅ Comprehensive API documentation
cd server
npm install
# Copy .env.sample to .env and configure
cp .env.sample .env
# Start development server
npm run devThe backend will start at http://localhost:5000
See server/README.md for detailed API documentation.
The React frontend has been fully implemented with all required components, pages, and services as functional placeholders.
cd client
npm install
npm startThe frontend will start at http://localhost:3000
Frontend Features:
- ✅ All page components created
- ✅ Reusable UI components (Navbar, Sidebar, Cards, Tables)
- ✅ API service modules ready for backend integration
- ✅ Authentication context and protected routes
- ✅ Role-based navigation and access control
- ✅ Responsive layouts with CSS
See client/README.md and client/IMPLEMENTATION_SUMMARY.md for detailed frontend documentation.
Auth
- POST /api/auth/register — register a new user
- POST /api/auth/login — obtain JWT
Appointments
- POST /api/appointments — create appointment
- GET /api/appointments/me — list current user's appointments
- PUT /api/appointments/:id — update/reschedule/cancel
Triage & Beds
- POST /api/triage — create triage record (nurse)
- GET /api/beds — list beds
- PUT /api/beds/assign — assign bed to patient
Labs
- POST /api/labs/order — create a lab order (doctor)
- GET /api/labs/orders — lab technician dashboard (pending)
- PUT /api/labs/results/:orderId — lab technician uploads results
- GET /api/labs/:patientId — view patient's lab results
Prescriptions
- POST /api/prescriptions — create e-prescription (doctor)
- GET /api/prescriptions/pending — pharmacist dashboard
- PUT /api/prescriptions/:id — pharmacist dispenses/rejects
Refer to AGENTS.md for full details, data models, validation, and role-based rules.
- User (name, email, password, role, digitalHealthCardId)
- Appointment (patientId, doctorId, date, time, status)
- TriageRecord (vitals, symptoms, severityLevel, admissionStatus)
- LabOrder (testType, status, results, priority)
- EPrescription (medications[], status, validatedBy)
- Bed (bedNumber, ward, status)
See AGENTS.md for the prioritized implementation plan, and acceptance criteria for each task:
- Backend skeleton, auth, appointment endpoints
- Triage, bed management, labs, prescriptions
- Frontend dashboards and flows
- Backend tests: Jest + supertest for route tests
- Linting: ESLint + Prettier
- CI: GitHub Actions to run lint and tests on PRs
Please see CONTRIBUTING.md for detailed contribution guidelines.
- JWT tokens include a role claim for role-based access control.
- Lab results are entered manually via a lab technician UI (no instrument integration in MVP).
- No advanced privacy auditing is implemented in MVP (discuss if needed).
Project brief
A domain brief was used to scope the project and determine user roles and use cases. All technical details needed for implementation are included in AGENTS.md.
License
This project is licensed under the MIT License - see the LICENSE file for details.