Synapse Care — Personal Health Operating System

Team: Hexa Binary | Track: Healthcare Technology | Platform: Mobile (Android / iOS) + IoT Wearable


The Problem

India has 230 million people over 50 managing chronic conditions. The average elderly patient sees 3.2 different doctors — none of whom know what the others prescribed. Adverse drug reactions cause 3–5% of all hospital admissions. That's one preventable crisis every 90 seconds.

An elderly patient managing 7 medications for blood pressure, diabetes, and thyroid — prescribed by three different specialists — gets a new painkiller added. Nobody flags that it reacts dangerously with her existing blood thinner. She takes both. Her family finds out three days later.

This is not a rare edge case. This happens every day. Because the information was never connected.

Existing apps fail in predictable ways:

App What it does What it misses
Medisafe Reminds you Knows nothing about what you already take
ABHA Stores records No interaction check, no vitals, no alerts
Generic trackers Logs pills Cannot detect adverse reactions

What We Built

Synapse Care connects what you take, what your body does, and who your family needs to call — in one system, in real time.

It is built around five integrated layers:

  1. Medication Intelligence — scans pills via OCR, checks every new drug against your full medication list using RxNorm + OpenFDA, surfaces contraindications before you take the first dose, compares prices against government generic equivalents, and builds a smart reminder schedule.

  2. Health Profile & Resume — a living, AI-maintained health summary built from onboarding data, uploaded medical reports, medication history, vitals trends, and teleconsultation notes. Every other layer reads from it.

  3. IoT Vitals & Safety Engine — a custom ESP32 wearable (MAX30102 for SpO2/HR, DS18B20 for temperature, MPU6050 for fall/crash detection) streams live vitals to Firebase every 30 seconds. A Cloud Function runs anomaly detection and cross-correlates abnormal readings with recently added medications to flag possible adverse reactions.

  4. Emergency Response — a public HTTPS endpoint accessible from the lock screen (no app, no login, no JavaScript) that displays blood type, allergies, active medications, and emergency contacts. In SOS mode, live vitals are appended automatically. Guardians receive a push + GPS location and can book a teleconsult with a pre-generated AI report in one tap.

  5. Cycle Intelligence — for female users, menstrual phase data is overlaid with IoT vitals to detect anomalies that no period tracker can catch, because it has no access to real physiological data.


What Makes It Different

Most health apps treat their features as isolated modules. Synapse Care treats them as one system.

When you add Ibuprofen at 8 PM and your heart rate spikes to 147 BPM six hours later, Synapse Care does not just alert you — it says: "Ibuprofen was added 6 hours ago. Known interaction with Warfarin in your profile. Recommend immediate consultation." No other consumer health app does this, because no other consumer health app has both the medication history and the live vitals in the same system.

When a bystander scans the QR on an unconscious patient's phone, they get blood type, allergies, every active medication with dosage, and emergency contacts — loaded in under 2 seconds on 3G, with no app install required.


System Architecture

                    MOBILE APP
             React Native · Expo · TypeScript
                          │
        ┌─────────────────┼─────────────────┐
        │                 │                 │
   DRUG INTEL APIs   FIREBASE BACKEND   IOT PATCH
   RxNorm (NLM)      Firestore          ESP32 + sensors
   OpenFDA           Realtime DB        MAX30102 (SpO2/HR)
   Jan Aushadhi      Cloud Functions    MPU6050 (IMU)
   1mg / PharmEasy   FCM · Auth         DS18B20 (Temp)
                          │
        ┌─────────────────┼─────────────────┐
        │                 │                 │
   RAG BACKEND    EMERGENCY ENDPOINT   WEARABLE LAYER
   LLM + FAISS    Next.js · Public     Mi Band SDK
   Medical KB     No login · <2s 3G    Health Connect
                  Serves QR endpoint   HealthKit (iOS)

Complete data flow — medication scan:

Scan pill bottle  →  ML Kit OCR (on-device)   →  Name · Dose · Expiry
                  →  RxNorm normalize          →  Canonical drug name
                  →  OpenFDA interact check    →  Severity flag (blocked / warn / ok)
                  →  Jan Aushadhi lookup       →  Price + nearest generic store
                  →  NLP schedule parse        →  Daily reminder schedule
                  →  Firebase write            →  Inventory + Health Resume
                  →  FCM + Mi Band push        →  Wearable reminder

Complete data flow — IoT anomaly:

IoT patch reads   →  Firebase RTDB (every 30s) →  Guardian dashboard live
                  →  Cloud Function onWrite    →  Anomaly check
                  →  Threshold breached?
                      YES → Push alert         →  Patient + guardian notified
                          → Med correlation    →  Adverse reaction flag
                          → Critical?
                              YES → SOS mode   →  Live vitals on QR endpoint
                                  → GPS share  →  Emergency contacts
                                  → Doctor map →  Teleconsult booking

Tech Stack

Category Technology
Framework React Native 0.74 + Expo SDK 51
Language TypeScript (strict)
Navigation Expo Router v3
State Zustand + TanStack React Query
Styling NativeWind v4
OCR Google ML Kit (on-device, handles Devanagari)
Drug Data RxNorm (NLM) + OpenFDA
Price Data Jan Aushadhi + 1mg + PharmEasy
Voice Expo Speech + react-native-voice (Hindi + English)
Wearable Mi Band SDK + Health Connect + HealthKit
Backend Firebase (Firestore + RTDB + Cloud Functions + FCM)
Auth Firebase Auth (OTP + Google)
IoT Hardware ESP32, MAX30102, DS18B20, MPU6050
Emergency Web Next.js (separate repo, public endpoint)
RAG Backend LLM + FAISS vector store, medical knowledge base

Five Layers — Detail

Layer 1 — Medication Intelligence (Core Problem Statement)

Every medication goes through this pipeline on add:

  1. On-device OCR extracts name, dose, quantity, and expiry. No image leaves the phone.
  2. RxNorm normalizes brand name to canonical generic (e.g. "Crocin" → "Paracetamol") and fetches rxcui.
  3. OpenFDA runs a full combinatorial interaction check — not a simple two-drug lookup, but new drug against every drug in the existing inventory.
  4. Result is classified: Contraindicated (blocked), Major (acknowledge to proceed), or Minor / None (proceed).
  5. Jan Aushadhi dataset lookup shows government generic price vs. market price and nearest Jan Aushadhi Kendra by GPS.
  6. NLP parses the dosage label into a structured schedule ("2 tablets twice daily after meals" → time, quantity, food dependency).
  7. Reminders delivered via FCM (Android) and Mi Band / HealthKit (wearable).

Expiry alerts fire at 30 days, 7 days, and 1 day. Vaccination reminders use the age-based Indian immunization schedule.

Layer 2 — Health Profile & Resume

A living health summary maintained automatically from: onboarding form, uploaded PDFs/images of reports, medication inventory, IoT vitals history, and teleconsultation notes. It feeds the Emergency QR endpoint, RAG assistant context, teleconsult AI report generator, and Cycle Intelligence baseline.

Layer 3 — IoT Vitals & Safety Engine

Hardware specs:

Sensor Measures Accuracy
MAX30102 SpO2 + Heart Rate ±2% SpO2, ±3 BPM
DS18B20 Body Temperature ±0.5°C
MPU6050 6-axis IMU (fall + crash detection)
ESP32 Wi-Fi + BLE + 240MHz ~72h on LiPo

Fall detection: >3G spike + horizontal orientation >3 seconds. Crash detection: >4G deceleration + GPS velocity drop. Both trigger a 30-second cancel window before SOS activates.

The key innovation is medication–vitals correlation: when an anomaly is detected, Cloud Functions check whether any medication was added in the preceding 24 hours and whether a known interaction exists — surfacing a possible adverse reaction flag rather than a generic alert.

Layer 4 — Emergency Response

The emergency QR endpoint is a static public HTTPS page that:

  • Loads from the phone's lock screen with no unlock required
  • Requires no app, no login, no JavaScript
  • Loads in under 2 seconds on 3G
  • Displays blood type, allergies, active medications, chronic conditions, and emergency contacts
  • In SOS mode: appends live vitals automatically

Guardian alert flow: push notification + GPS → "Book Teleconsult" CTA → Doctor Health Map filtered by anomaly type and specialty → booking confirmed → AI report auto-generated from Health Resume → doctor receives report before the call begins → post-call notes ingested back into Health Resume.

Layer 5 — Cycle Intelligence

Available for female users. Menstrual phase is tracked alongside IoT vitals (BBT from temperature sensor, HR variability, SpO2 patterns) to detect:

  • Irregular cycle length
  • Unexpected BBT spikes or drops
  • Elevated HR across phases
  • Low SpO2 pattern
  • Medications in the profile known to affect cycle regularity

All insights are informational pattern signals. They do not constitute a diagnosis and always include a prompt to consult a doctor.


Firebase Data Architecture

Firestore collections:

users/{uid}                          UserProfile
users/{uid}/medications/{id}         Medication
users/{uid}/documents/{id}           Uploaded health documents
users/{uid}/anomaly_log/{id}         AnomalyEvent
users/{uid}/sos_events/{id}          SOSEvent
users/{uid}/teleconsultations/{id}   Teleconsult records
users/{uid}/cycle/{id}               CycleEntry
emergency/{qrToken}                  EmergencySummary (public read, auth write)

Realtime Database (IoT stream):

/vitals/{uid}/current        Latest reading (overwritten every 30s)
/vitals/{uid}/stream/{ts}    Individual readings during SOS mode only

Security rules:

Path Read Write
users/{uid}/** uid == auth OR linked guardian uid == auth
emergency/{token} Public Authenticated only
/vitals/{uid}/** uid == auth OR linked guardian IoT service account

Scope

This repository covers the React Native mobile app. The following are separate:

Component Status
Emergency QR public web page Separate Next.js repo
Firebase Cloud Functions Separate functions repo
ESP32 IoT firmware Separate C/Arduino repo
ABHA health ID integration Planned for v2.0

Setup

git clone https://github.com/hexa-binary/synapse-care
cd synapse-care
pnpm install
cp .env.example .env.local
# Fill EXPO_PUBLIC_ values
pnpm expo start

Required environment variables: Firebase config (API key, auth domain, project ID, RTDB URL), RxNorm base URL, OpenFDA base URL, PharmEasy / 1mg API keys, Jan Aushadhi dataset URL, RAG API URL and key, Google Maps API key.


Built for the 230 million people who deserve a system that actually connects the dots.

Built With

  • ai/ml
  • and
  • basic
  • ble-(wearable/iot)
  • db
  • esp32-(iot-hardware)
  • fcm)
  • firebase-(auth
  • for
  • google-maps
  • kotlin-(android)
  • node.js/express-(backend)
  • react-+-tailwind-(web)
  • supabase-(storage)
  • triage
  • websockets/rest-apis
Share this project:

Updates