
HARMONY Authorities Portal empowers health authorities, government health departments, and public health officials with real-time analytics from blockchain-backed health records, enabling early outbreak detection, resource optimization, and evidence-based policy decisions.
Key Innovation
Combines blockchain immutability with selective field encryption, giving authorities verifiable health data while preserving patient privacy. No patient identifiers exposed. Fetches encrypted records from blockchain nodes → Decrypts with AES-256-GCM → Preprocesses (normalize, aggregate, analyze) → Visualizes in interactive dashboard.
Impact: Reduces surveillance lag from weeks to hours, enables predictive resource allocation, detects anomalies with statistical rigor (z-scores, diversity indices), and provides transparent data quality metrics.
Core Features
• Statistical Reports Management: Upload multiple file formats (PDF, Word, Excel, PowerPoint, Images) with rich metadata including categories, regions, time periods. Public/private visibility controls with file download tracking and analytics.
• Advanced Analytics Dashboard: Blockchain health data integration with disease surveillance monitoring, vaccination trend analysis, environmental health metrics, and real-time health alerts and notifications.
• Real-Time Analytics: Fetches encrypted records from blockchain nodes, decrypts with AES-256-GCM, preprocesses data (normalize, aggregate, analyze), and visualizes in interactive dashboards. Features 5-minute server-side caching with automatic fallback to probe snapshots.
• Advanced Visualization: Time-series trends, geographic heatmaps, Sankey flow diagrams, and anomaly detection. Interactive charts with bubble/heatmap toggle, bar/treemap toggle for drug analysis.
• Evidence-Based Decision Making: Statistical baselines, z-score analysis, diversity indices, and growth metrics for resource allocation and seasonal planning.
• Disease Surveillance: Automated spike detection (z > 3σ), emerging disease identification, and regional outbreak monitoring with 60%+ growth rate alerts.
• Data Integrity Verification: Transparent field-level provenance (decrypted vs plaintext vs auth-failed) with real-time integrity dashboard showing decryption success rates.
• Search & Discovery: Advanced filtering by category, region, time period with full-text search across reports and metadata. Trending reports discovery and authority profile browsing.
Technical Architecture
• Frontend Stack: React 18 + TypeScript + Vite with Tailwind CSS custom authority theme, Radix UI components for accessibility, Wouter for client-side routing, React Query for server state management, React Hook Form with Zod validation.
• Backend Stack: Node.js + Express.js with TypeScript, Supabase for database and authentication, Multer for file upload handling, UUID for unique identifiers.
• Database & Storage: Supabase PostgreSQL with Row Level Security (RLS). Three main tables: authority_profiles (user profiles with verification), authority_stats (statistical reports), authority_stats_comments (collaboration threads).
• Blockchain Integration: Read-only analytics consumer of blockchain-backed health data. Parallel HTTP requests to Hospital API (localhost:48080) and Authorities API (localhost:48083) with bearer token authentication. Field-level decryption using AES-256-GCM with HKDF-derived keys.
• Analytics Pipeline: Server-side processing with 5-minute cache TTL, automatic fallback to probe snapshots if blockchain unavailable, integrity tracking for decrypted/plaintext/auth-failed fields.
• Preprocessing Pipeline: 500+ lines of pure transformation functions including data cleaning (label normalization, null handling), time filtering & bucketing (day/week/month), statistical aggregations (moving average, Shannon entropy, z-scores), and flow analysis (Sankey diagrams).
Analytics Dashboard Features
• Overview Tab: KPI cards (total patients, checkups, public records), regional distribution bar charts, top diseases, diagnosis→drug mapping (stacked bar), diversity over time (line chart), field integrity dashboard, emerging diseases list, top drugs (bar/treemap toggle), patient flow metrics.
• Disease Trends Tab: Line chart mode with 7-day moving average and spike markers (red dots when value > MA × 2), stacked area mode for proportional view showing shifting disease composition.
• Map & Flows Tab: Geographic intelligence with bubble/heatmap toggle, diagnosis→drug Sankey flow diagrams, anomalies & alerts with data-driven tables and z-score analysis.
• Regional Tab: Area-specific metrics including record counts per area, geographic hotspots list, 7-day growth by area, diversity per region (Shannon H).
Statistical Methods
• Moving Average (7-day): Smoothing time-series and detecting spikes • Shannon Diversity Index: Measures disease diversity in region/time period (H = -Σ p_i ln(p_i)) • Regional Growth Percentage: Compares last 7 days vs prior 7 days • Baseline Statistics (Z-Score): Number of standard deviations from baseline (z = (latest/days - μ) / σ) • Spike Detection: Detected when latest > MA × (1 + factor)
Security & Privacy
• Row Level Security (RLS) policies for data isolation • JWT-based authentication with Supabase • File upload validation and virus scanning • Rate limiting and CORS protection • Secure file storage with access controls • AES-256-GCM envelope encryption with authenticated encryption • Zero PII exposure - no patient identifiers visible to authorities
Key API Endpoints
• Authentication: /api/auth/register, /api/auth/me, /api/auth/profile • Statistics: /api/stats/upload, /api/stats/public, /api/stats/my-stats, /api/stats/:id • Analytics: /api/analytics/overview, /api/analytics/personal, /api/analytics/trending, /api/analytics/live (with force refresh support) • File Upload: /api/upload/avatar, /api/upload/files
Refresh Strategies
• Manual Refresh: Authorities click button → hits /api/analytics/live?force=1 → server bypasses cache, fetches fresh blockchain data → React Query refetches, UI updates immediately • Login-Triggered Refresh: Silent background refresh after authentication • Hourly Auto-Refresh: Silent updates every 60 minutes with fallback to cached snapshot on failure
How This Helps Authorities
• Early Outbreak Detection: Detect disease spikes within hours, not weeks (z-score analysis triggers automatic alerts) • Resource Allocation: Deploy resources to regions with 60%+ growth rates first • Seasonal Planning: Predict staffing needs 2-3 months ahead using 90-day baseline comparison • Disease Diversity Monitoring: Identify underserved areas for health equity initiatives (Shannon entropy per region) • Drug Utilization Review: Identify prescribing patterns for clinical guidelines validation • Data Quality Assurance: Real-time integrity dashboard with field-level provenance
This project demonstrates expertise in building secure, privacy-preserving public health surveillance systems that combine blockchain immutability with advanced analytics, statistical rigor, and evidence-based decision support for government health officials.
























