OTZ_MRS is a comprehensive management and reporting system designed for the Operation Triple Zero (OTZ) initiative, focusing on Children and Adolescents Living with HIV (CALHIV). The system streamlines patient tracking, clinical workflows, and reporting for healthcare workers (HCW) and patients (ROC - Retention of Care).
The project is built using a modern full-stack architecture:
- Backend: Node.js/Express with an MVC (Model-View-Controller) pattern.
- Services Layer: All database operations are abstracted into service classes in
backend/utils/db.jsto ensure consistency and reusability. - Database: MongoDB (via Mongoose) for persistent storage.
- Caching: Redis for session management and token blacklisting.
- Authentication: JWT-based authentication with role-based access control (HCW vs. ROC).
- Services Layer: All database operations are abstracted into service classes in
- Frontend: React 19 powered by Vite.
- UI Framework: Tailwind CSS with Radix UI/shadcn components.
- State Management: React hooks and custom hooks for data fetching.
- Authentication: Integrated with
react-auth-kitfor secure route protection.
- Patient Management: Comprehensive registration and profile updates for Children and Adolescents Living with HIV (CALHIV).
- Clinical Workflows:
- Triage: Record and track vitals (Weight, Height, Blood Pressure).
- Lab Orders: Manage Viral Load (VL) results and historical data.
- Pharmacy: Track ART regimens, start dates, and regimen lines.
- Appointments: Schedule and monitor follow-up visits to ensure retention in care.
- Automated Reporting: Generate complex, facility-ready Excel reports with a single click:
- OTZ Monthly Report: Comprehensive monthly statistics.
- STF (Suspected Treatment Failure) Report: Track patients with high viral loads.
- Viral Load Summary: Detailed VL tracking across the facility.
- Content Management: Create, update, and manage educational modules for patients.
- User Management: Administer HCW accounts and roles.
- Personal Health Record: Secure access to personal clinical data.
- Vitals Tracking: View historical weight, height, and BP trends.
- Lab Results: Access Viral Load results and dates.
- Treatment History: Monitor current ART regimens and pharmacy history.
- Appointment Reminders: View upcoming clinic dates to improve adherence.
- Role-Based Access Control (RBAC): Strict separation between HCW and ROC functionalities.
- Secure Authentication: JWT-based auth with Redis-backed token management for enhanced security.
- Data Visualization: Interactive charts and progress indicators for clinical metrics.
- Responsive Design: Fully responsive UI built with Tailwind CSS and Radix UI components, optimized for both desktop and mobile use.
- Excel Integration: High-fidelity Excel export using
exceljsfor official reporting. - System Health Monitoring: Built-in status checks for Database and Redis connectivity.
| Component | Technology |
|---|---|
| Frontend | React 19, Vite, Tailwind CSS, Radix UI, Chart.js |
| Backend | Node.js, Express, Mongoose, Redis, JWT |
| Testing | Mocha, Chai, Sinon |
| Reporting | ExcelJS |
| Auth | React Auth Kit, Bcrypt |
OTZ_MRS/
βββ backend/ # Express Server
β βββ controllers/ # Request handlers
β βββ middleware/ # Auth & validation middleware
β βββ model/ # Mongoose schemas
β βββ routes/ # API route definitions
β βββ utils/ # Services (db.js), Redis, Errors
β βββ server.js # Entry point
βββ frontend/ # React Client
β βββ src/
β β βββ components/ # UI & Role-specific components
β β βββ lib/ # Utilities
β β βββ Axios.js # API client wrapper
β β βββ visitData.js # Custom data fetching hooks
β βββ vite.config.js # Vite configuration
βββ .github/ # Copilot instructions & CI
- Node.js (v18+)
- MongoDB
- Redis Server
-
Clone the repository:
git clone https://github.com/elviswangari/OTZ_MRS.git cd OTZ_MRS -
Setup Backend:
cd backend npm installCreate a
.envfile inbackend/:PORT=3001 DB_URL=mongodb://localhost:27017/otz_mrs SECRET_KEY=your_jwt_secret
-
Setup Frontend:
cd ../frontend npm install
- Start Backend (Dev):
cd backend npm run dev - Start Frontend (Dev):
cd frontend npm run dev
Backend tests are written using Mocha and Chai.
cd backend
npm test- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Elvis Wangari - elviswangari@gmail.com
Project Link: https://github.com/elviswangari/OTZ_MRS