A secure, privacy-first, consent-governed digital healthcare interoperability platform enabling patients, hospitals, and insurance providers to access and manage medical records with complete control.
HealthSync solves the problem of fragmented healthcare records by aggregating patient data across hospitals, diagnostic centers, and paper files into a single, unified digital health identity. Patients retain full ownership over their data, granting temporary, scoped access to doctors and insurers via QR codes and OTP verification.
| Health timeline | Medical records |
|---|---|
![]() |
![]() |
| Follow-up safety net | Consent & sharing |
![]() |
![]() |
Screenshots use a fictional demo patient.
π For a full walkthrough of the concepts and workflows, see the HealthSync guide (PDF).
- Cross-Hospital Aggregation: Centralizes prescriptions, lab reports, radiology imaging, discharge summaries, and vaccination certificates across all healthcare facilities.
- Chronological Health Timeline: Month-by-month visual timeline (
TimelineView.jsx) with live record counts, category filters, date-range selectors, and keyword search. - Data Integrity: Differentiates between hospital-issued records (read-only and tamper-proof) and self-reported patient uploads.
- Active Cabinet & History Tracking: Dedicated medication cabinet (
MedicationCabinetView.jsx) separating currently active medications from discontinued/past prescription history. - Drug Interaction & Allergy Alerts: Automatically cross-references active prescriptions to detect drug-drug interactions and patient allergies in real-time.
- Status Controls: One-click toggling between Active and Completed/Discontinued prescription statuses.
- Incidental Recommendation Tracking: Automatically parses radiology and discharge prose for future clinical promises ("Repeat chest CT in 6 months").
-
Confidence Gating State Machine:
-
$\ge$ 0.80 Confidence: Automatically logged as activeopenobligation. -
0.45 β 0.79 Confidence: Logged as
pending_confirmasking the patient to confirm. - < 0.45 Confidence: Discarded to prevent false alarm fatigue.
-
-
Automated Escalation Scheduler: Background cron job (
followupScheduler.js) executing multi-tier alerts (T-30, T-7, due date, T+1, T+30 overdue). -
Auto-Closure Engine: Detects incoming lab or imaging records that fulfill open obligations and marks them
completed.
- Format Support: Supports PDF (vector text layers & scanned images), PNG, JPG, WebP, and HEIC files (up to 25 pages / 60 MB per scan).
- Image Preprocessing & Rasterization: Image despeckling, contrast enhancement, auto-rotation via
sharp, and multi-page PDF page rasterization viamupdf. - Offline OCR Pool: Tesseract.js worker pool using offline trained data (
@tesseract.js-data/eng) with CPU concurrency queuing and idle worker auto-teardown.
- Patient-Driven Sharing: Grant temporary access to doctors, hospitals, or insurance adjusters via QR code or OTP verification.
- Granular Permission Checkboxes: Selectively toggle permission scopes (
medicalHistory,prescriptions,reports,allergies,bloodGroup). - Instant Revocation & Audit Logs: Patients can revoke provider access at any time. Immutable audit logs (
AuditLog.js) record every access event, timestamp, and provider identity.
- Policy Management: Patients link health insurance policies directly to their vault.
- Consent-Backed Claims: File claims with attached medical proof and diagnostic records.
-
Claim Lifecycle Tracking: Real-time status tracking (
Submitted$\rightarrow$ Under Review$\rightarrow$ Info Requested$\rightarrow$ Approved/Rejected). -
Multi-Party Live Chat: Built-in real-time messaging thread (
ClaimDetailDrawer.jsx) between patient, hospital billing, and insurance adjusters.
- Regional & Public Alerts: Targeted health advisories and WHO disease outbreak news broadcast directly to patient dashboards.
- WebSockets: Real-time live notifications and message badges powered by Socket.IO.
- Dual-Token Authentication: JWT Access Tokens & Refresh Tokens with automatic Refresh Token Rotation and secure HTTP-only cookies.
- Account Lockout & Rate Limiting: Account lockout after consecutive failed login attempts, authentication rate limiters, and
bcryptpassword hashing. - Security Headers & Sanitation: Protected by
Helmet,HPP, MongoDB injection protection, XSS sanitization, andexpress-validator.
- Runtime: Node.js, Express.js (v5)
- Database: MongoDB, Mongoose ORM
- Real-time: Socket.IO
- OCR & Image Processing: Tesseract.js, Sharp, MuPDF, PDF-Parse
- Security: Helmet, Express Rate Limit, Express Validator, HPP, Express XSS Sanitizer, bcryptjs, JSONWebToken
- Email & Utilities: Nodemailer, Winston Logger, Compression, Cookie Parser
- Framework: React 19, Vite, React Router
- Styling: Tailwind CSS 4, Lucide React Icons
- Real-time Client: Socket.IO Client
- Backend: 200+ Jest + Supertest tests across auth, OCR, follow-ups, insurance, consent and the AI pipeline
HealthSync/
βββ Backend/
β βββ scripts/ # Database seeders (seedAdmin.js, seedInsurance.js)
β βββ src/
β β βββ config/ # Security, upload, & report configurations
β β βββ constants/ # Follow-up & Record Type constants
β β βββ controllers/ # Express controllers (auth, record, consent, insurance, etc.)
β β βββ jobs/ # Background cron jobs (followupScheduler.js)
β β βββ middleware/ # Auth, RBAC, Rate limiters, Validation
β β βββ models/ # Mongoose schemas (User, MedicalRecord, Claim, FollowUp, etc.)
β β βββ routes/ # API routes (patient, hospital, insurance, dev, advisory)
β β βββ services/ # Service layer (ocr, followup, record, consent, insurance, extractors)
β β βββ utils/ # ApiError, ApiResponse, Logger, AsyncHandler
β β βββ app.js # Express app setup & security middleware
β β βββ server.js # HTTP & Socket.IO server initialization
β β βββ socket.js # Socket.IO connection & event handlers
β βββ tests/ # Jest test suites (auth, ocr, followup, insurance, batchScan)
βββ Frontend/
β βββ src/
β β βββ components/ # UI components (TimelineView, MedicationCabinetView, ConsentsView, etc.)
β β βββ context/ # AuthContext
β β βββ lib/ # API client helpers, Socket client, Formatters
β β βββ pages/ # Dashboards (Patient, Hospital, Insurance, Admin, Login, Signup)
β β βββ App.jsx # Main router
β β βββ main.jsx # Entry point
Requirements: Node.js 20+ and MongoDB (local install, Atlas, or docker run -d -p 27017:27017 mongo:7).
git clone https://github.com/itsnjstyle27/HealthSync.git
cd HealthSync# Install Backend dependencies
cd Backend
npm install
# Install Frontend dependencies
cd ../Frontend
npm installCopy the example file and fill in the two token secrets (64+ random characters each):
cd Backend
cp .env.example .envEverything else has working defaults. Backend/.env.example documents every setting:
- SMTP is optional. Without it, new accounts are verified automatically in development.
- AI summaries and embeddings are off until you set
AI_API_KEY. OCR and the rule-based follow-up extractor work fully offline.
The frontend calls http://localhost:5000/api by default. To point it elsewhere, set VITE_API_URL in Frontend/.env.
# Start Backend server (from Backend folder)
npm run dev
# Start Frontend development server (from Frontend folder)
npm run dev # http://localhost:3000cd Backend
npm test # uses MONGO_URI_TEST from .env- Authentication & Security Foundation β Dual JWT, token rotation, account lockout, rate-limiting
- Unified Medical Record Vault β Multi-category record storage, OCR, self-reported vs. hospital-issued records
- Interactive Health Timeline β Chronological month-by-month history with filter facets and search
- Medication Cabinet & Safety Guard β Active cabinet, history tracking, real-time drug interaction & allergy alerts
- Follow-up Loop Closure Safety Net β Incidental recommendation extraction, confidence gating, auto-closure engine
- Consent-Based Access Control β OTP & QR code access, granular permission checkboxes, instant revocation
- Doctor & Hospital Dashboard β Linked patient lookup, QR/OTP verification, clinical record issuance
- Insurance Integration & Claims β Policy linking, claim lifecycle management, real-time multi-party claim chat
- Health Advisories & Public Alerts β Targeted health broadcasts, WHO disease outbreak alerts
- Real-time WebSockets β Socket.IO notifications, status badges, and claim chat threads
- Neerav Mishra: creator and maintainer. Built authentication, the landing and sign-in flows, the patient and hospital dashboards, the admin portal, the OCR pipeline and the follow-up safety net.
- Ayush Pratap Singh: insurance and claims, the medication cabinet, the HealthSync ID system, and the AI health assistant with its RAG pipeline.
This project is licensed under the MIT License.





