Skip to content

rodrigomarcelo643/HealthWatchWeb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

489 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HealthWatch Logo

HealthWatch: Community Intelligence Network for Early Outbreak Detection

React TypeScript Vite Firebase Tailwind CSS Cloudinary n8n

Category: – Good Health and Well-Being

🎯 Problem Statement

The Philippines has no shortage of health dataβ€”it has a shortage of the right data at the right time. The current approach to outbreak detection is reactive, seeing outbreaks only after hospital admissions spikeβ€”when it's already too late for prevention. Communities themselvesβ€”the people who notice the first fever, the first child with diarrhea, the first neighbor who looks sickβ€”have no structured way to share what they see.

Current System Inefficiencies:

  • Manual Reporting Delays - Paper-based reports take weeks to process and reach health authorities
  • Health Center Bottlenecks - Long waiting times during outbreak investigations while cases multiply
  • Repetitive Data Collection - BHWs repeatedly ask the same questions during health visits, wasting valuable time
  • Information Silos - Resident health histories scattered across different systems with no centralized access
  • Delayed Response - Critical time lost between symptom onset and official health response

πŸ’‘ Solution

HealthWatch builds a community intelligence network that trains everyday Filipinosβ€”sari-sari store owners, tricycle drivers, market vendors, traditional hilots, and religious leadersβ€”to become the first line of outbreak detection in their neighborhoods. Each resident receives a unique QR code that health workers, partner clinics, and authorized healthcare providers can scan to instantly access complete health profiles, self-reported symptoms, verified health trends, and real-time pattern analysisβ€”transforming weeks of manual processing into seconds of digital intelligence with built-in safeguards that separate genuine signals from noise and misinformation.

Digital QR Health Passport: When residents visit potential healthcare partners (clinics, hospitals, pharmacies), their QR code provides instant access to all self-reported symptoms, verified health trends, and pattern analysisβ€”eliminating repetitive questioning and enabling faster, more informed medical responses based on comprehensive health data rather than starting from scratch each visit.

πŸ‘₯ Target Users

Primary Users (Community Health Watchers):

  • Sari-Sari Store Owners & Market Vendors
  • Tricycle Drivers & PUV Operators
  • Barangay Tanods & Leaders
  • Religious Leaders & Church Workers
  • Traditional Healers & Hilots
  • Barangay Health Workers

Beneficiaries:

  • Entire Communities (faster detection = faster response)
  • Vulnerable Populations (elderly, children, pregnant women, PWDs)
  • Municipal & Provincial Health Officers
  • Department of Health & Epidemiologists

✨ MVP Core Features

πŸ₯ BHW (Barangay Health Worker) Dashboard

  • Health Watcher Management - Approve/reject community watcher applications with document verification
  • Real-time Observations - Live monitoring with 7-day trend analysis and symptom radar charts
  • QR Code Scanner - Instant resident lookup with live health data, symptom history, and trend visualization
  • Interactive Mapping - Real-time outbreak visualization with geographic clustering
  • Outbreak Pattern Recognition - AI-powered detection of disease patterns and anomalies
  • Community Announcements - Broadcast health advisories and alerts to residents

πŸ‘₯ Community Health Watcher Network

  • Multi-Step Registration Process
    • Step 1: Personal verification (name, email, contact, region/municipality/barangay)
    • Step 2: Document verification (valid ID upload + selfie verification)
    • Step 3: Credential finalization and approval waiting status
  • Mobile App Dashboard
    • Home screen with health summary and status overview
    • History section for tracking reported symptoms
    • Plus icon for quick symptom reporting (self-report vs observed)
    • Profile with unique QR code for healthcare provider scanning
  • Real-Time Information Feed
    • Live announcements and outbreak alerts
    • BHW directories with hotlines and emergency contacts
    • Push notifications for health advisories
  • Community Intelligence
    • Interactive map showing nearby verified reports (latest only)
    • Anonymous community symptom visualization
    • Geographic clustering of health observations
  • Observation Reporting - "What do you see?" approach vs. direct symptom reporting
  • Two-Way Communication - Receive acknowledgments and health advisories
  • Future Integration - Community forums for health discussions

πŸ” Real-Time Intelligence

  • Live Data Sync - Instant updates across all dashboards and mobile devices
  • 3-Watcher Rule - Multi-source validation before outbreak alerts
  • AI Trust Scoring - Validates watcher reliability and filters spam
  • Spatial Clustering - DBSCAN algorithm for geographic pattern detection
  • Predictive Analytics - Early warning system for potential outbreaks

πŸ“± Mobile-First Design

  • Progressive Web App (PWA) - Works offline, low-bandwidth optimized
  • Audio Feedback - Beep sounds and text-to-speech for accessibility
  • Real-time Notifications - Instant alerts for new cases and announcements
  • Cross-Platform - Seamless experience across desktop, tablet, and mobile

🎯 Key Innovations

  • πŸ“± Mobile-First PWA - Works offline, low-bandwidth optimized
  • πŸ”’ AI-Powered Trust Scoring - Validates watcher reliability (0-100 score)
  • βœ… 3-Watcher Rule - Multi-source validation before alerts
  • πŸ—ΊοΈ Observation Heatmaps - Real-time geographic clustering
  • πŸ”„ Two-Way Feedback Loop - Communities receive acknowledgments and advisories
  • πŸ›‘οΈ Multi-Layered Spam Prevention - Rate limiting, behavior monitoring, AI filtering
  • 🎯 Proximal Intelligence - Catches outbreaks at pre-clinic stage
  • πŸ† Incentive System - Load credits, recognition badges, community rankings
  • πŸ’³ Subscription Management - Track account and payment status separately
  • 🎨 Enhanced Toast Notifications - Progress bar, auto-close, smooth animations

πŸ—οΈ Tech Stack

Frontend:

  • React 18.3 + TypeScript 5.6
  • Vite 6.0
  • Tailwind CSS + Framer Motion
  • Progressive Web App (PWA)
  • Axios for HTTP requests

Backend & Database:

  • Firebase (Auth, Firestore, Cloud Functions, Hosting)
  • Real-time observation processing
  • Multi-tenant architecture for LGUs

AI/ML Components:

  • Trust Score Engine
  • DBSCAN Spatial Clustering
  • NLP for observation categorization (GPT API)
  • Anomaly Detection & Spam Classification
  • Predictive Correlation Models

Integrations:

  • Google Maps API (observation heatmaps)
  • Twilio API (SMS alerts & feedback)
  • EmailJS (health officer notifications)
  • Telecom partnerships (load credit incentives)

πŸ“ Project Structure

HealthWatch/
β”œβ”€β”€ src/                    # Frontend application
β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”‚   β”œβ”€β”€ ui/           # Base UI components (toast, dialog, button, etc.)
β”‚   β”‚   β”œβ”€β”€ auth/         # Authentication components (LoginDialog)
β”‚   β”‚   └── sections/     # Page sections (HeroSection)
β”‚   β”œβ”€β”€ pages/            # Application pages
β”‚   β”‚   β”œβ”€β”€ admin/        # Admin dashboard pages
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminDashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ BHWs.tsx           # BHW management with subscription status
β”‚   β”‚   β”‚   β”œβ”€β”€ Municipalities.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Regions.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Residentss.tsx
β”‚   β”‚   β”‚   └── Map.tsx
β”‚   β”‚   β”œβ”€β”€ bhw/          # BHW dashboard pages
β”‚   β”‚   β”‚   β”œβ”€β”€ BhwDashboard.tsx
β”‚   β”‚   β”‚   └── BhwResidents.tsx
β”‚   β”‚   └── public/       # Public pages
β”‚   β”‚       β”œβ”€β”€ LandingPage.tsx
β”‚   β”‚       β”œβ”€β”€ RegisterPage.tsx   # Registration with subscription status
β”‚   β”‚       └── PricingPage.tsx
β”‚   β”œβ”€β”€ layouts/          # Layout components
β”‚   β”‚   β”œβ”€β”€ admin/        # Admin layout
β”‚   β”‚   β”œβ”€β”€ bhw/          # BHW layout
β”‚   β”‚   └── municipal/    # Municipal layout
β”‚   β”œβ”€β”€ contexts/         # React contexts
β”‚   β”‚   └── AuthContext.tsx        # Authentication with Firestore role fetching
β”‚   β”œβ”€β”€ services/         # Service integrations
β”‚   β”‚   β”œβ”€β”€ openAiService/         # AI categorization (Axios-based)
β”‚   β”‚   β”œβ”€β”€ googleMapService/      # Maps integration
β”‚   β”‚   └── cloudinaryService/     # Image upload (Axios-based)
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ use-toast.ts           # Toast notification hook
β”‚   β”‚   └── use-mobile.ts
β”‚   β”œβ”€β”€ router/           # React Router configuration
β”‚   β”‚   └── index.tsx              # Routes with role-based protection
β”‚   β”œβ”€β”€ lib/              # Utility functions
β”‚   β”‚   β”œβ”€β”€ utils.ts      # Helper functions (cn utility)
β”‚   β”‚   └── firebase.ts   # Firebase client config
β”‚   β”œβ”€β”€ data/             # Static data
β”‚   β”‚   └── regions.ts    # Philippine regions data
β”‚   └── assets/           # Static assets (images, fonts, sounds)
β”‚
β”œβ”€β”€ backend/               # Backend services
β”‚   β”œβ”€β”€ webhooks/         # Webhook handlers
β”‚   β”‚   β”œβ”€β”€ observation-webhook.ts  # Observation processing
β”‚   β”‚   β”œβ”€β”€ sms-webhook.ts         # SMS notifications
β”‚   β”‚   └── auth-webhook.ts        # Authentication & registration
β”‚   β”œβ”€β”€ services/         # Backend services
β”‚   β”‚   └── email.ts      # Email notifications (OTP, approval, etc.)
β”‚   β”œβ”€β”€ middleware/       # Express middleware
β”‚   β”‚   β”œβ”€β”€ auth.ts       # Authentication middleware
β”‚   β”‚   β”œβ”€β”€ rateLimit.ts  # Rate limiting
β”‚   β”‚   β”œβ”€β”€ validation.ts # Input validation
β”‚   β”‚   └── errorHandler.ts # Error handling
β”‚   β”œβ”€β”€ config/           # Configuration
β”‚   β”‚   └── firebase-admin.ts # Firebase Admin SDK
β”‚   β”œβ”€β”€ rag/              # RAG processing
β”‚   β”‚   β”œβ”€β”€ prepare-rag.ts      # Process textbooks from Supabase
β”‚   β”‚   β”œβ”€β”€ query-rag.ts        # Interactive query tool
β”‚   β”‚   └── supabase-schema.sql # Database schema
β”‚   β”œβ”€β”€ server.ts         # Main webhook server
β”‚   └── package.json      # Backend dependencies (pnpm)
β”‚
β”œβ”€β”€ rag/                   # RAG data storage
β”‚   β”œβ”€β”€ health-guidelines/     # DOH/WHO guidelines
β”‚   β”œβ”€β”€ disease-patterns/      # Historical outbreak data
β”‚   β”œβ”€β”€ symptoms-database/     # Verified symptoms
β”‚   β”œβ”€β”€ medication-reference/  # Common medications
β”‚   β”œβ”€β”€ training-materials/    # Healthwatch training
β”‚   β”œβ”€β”€ advisories/           # Health advisories
β”‚   └── RAG_DOCUMENTATION.md  # RAG system guide
β”‚
β”œβ”€β”€ .agent/               # AI agent documentation
β”‚   β”œβ”€β”€ architecture/     # System architecture docs
β”‚   β”œβ”€β”€ features/         # Feature specifications
β”‚   β”œβ”€β”€ ai-ml/           # AI/ML documentation
β”‚   └── api/             # API integration docs
β”‚
β”œβ”€β”€ .claude/             # Claude AI integration
β”‚   β”œβ”€β”€ project-context.md  # Project overview
β”‚   β”œβ”€β”€ prompts.md         # Prompt library
β”‚   β”œβ”€β”€ commit-style.txt   # Git commit style guide
β”‚   └── config.json        # Project configuration
β”‚
β”œβ”€β”€ .github/             # GitHub Actions
β”‚   └── workflows/       # CI/CD workflows (disabled)
β”‚       β”œβ”€β”€ pr-validation.yml  # PR validation
β”‚       β”œβ”€β”€ ci-cd.yml         # Deployment pipeline
β”‚       └── code-quality.yml  # Code quality checks
β”‚
β”œβ”€β”€ public/              # Public assets
β”œβ”€β”€ firestore.rules      # Firestore security rules
β”œβ”€β”€ storage.rules        # Firebase storage rules
β”œβ”€β”€ firebase.json        # Firebase configuration
β”œβ”€β”€ .env.example         # Environment variables template
└── package.json         # Frontend dependencies (pnpm)

πŸš€ Getting Started

Frontend

# Install dependencies
pnpm install

# Run development server
pnpm run dev

# Build for production
pnpm run build

Backend

# Install dependencies
cd backend
pnpm install

# Run webhook server
pnpm run dev

# Prepare RAG data
pnpm run rag:prepare

πŸ”‘ Core Innovation

Instead of asking communities to report symptoms (which feels like surveillance), HealthWatch asks them to report what they observe (which feels like community participation):

  • More people buying paracetamol than usual?
  • Several children absent from community gatherings?
  • Neighbors mentioning the same illness?
  • Families boiling water after floods?

🎯 What Makes This Different

  • Taps Informal Observers - First system designed for sari-sari stores, tricycle drivers, market vendors
  • Observation-Based - "What do you see?" not "Who is sick?" (reduces privacy concerns)
  • Incentivized Participation - Real rewards tied to verified accuracy
  • Multi-Layered Spam Prevention - Progressive onboarding, rate limiting, AI filtering
  • 3-Sentinel Rule - Multiple unrelated sources required before alerts
  • Two-Way Communication - Closes the loop with communities
  • Proximal Intelligence - Catches outbreaks at pre-clinic stage
  • Community Empowerment - Active participants, not passive data sources

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


About

HealthWatch is a mobile-first network that enables early outbreak detection by verifying local health observations in real time, transforming community data into actionable public health intelligence.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages