Skip to content

zlnsk/lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HealthOura

A personal health dashboard that aggregates data from wearables, smart scales, and lab results into a single view with AI-powered insights. Built for anyone who wants to understand their medical data in an easy, AI-supported way.

Important: This tool is for informational purposes only. Always consult with your doctor before making any health decisions based on lab results or AI-generated recommendations.

Features

  • Lab Results Tracking — Upload blood test PDFs and track 150+ biomarkers over time with automatic reference range detection
  • Oura Ring Integration — Sync sleep, activity, readiness, heart rate, HRV, and workout data
  • Withings Scale Integration — Sync weight, body fat, muscle mass, and bone mass
  • AI Health Insights — Get personalized analysis of your lab trends powered by Google Gemini and Claude, with specific supplement and lifestyle recommendations
  • Longitudinal Trends — Visualize how your markers change across reports with interactive charts
  • Clinical Interpretation — Automatic detection of kidney function, cardiovascular risk, blood sugar, inflammation, and thyroid patterns
  • Optimal Ranges — Compare your results against evidence-based optimal ranges (not just lab reference ranges)

Tech Stack

Layer Technology
Frontend React 19 + TypeScript + Vite 8
UI Material-UI (MUI) 7 + Recharts
Backend Node.js API (self-hosted via Docker)
Database Supabase (PostgreSQL) with Row-Level Security
Auth Supabase Auth (Google OAuth)
AI Google Gemini 2.5 Flash (primary) + Claude Haiku (fallback)

Project Structure

api/                    API endpoints
  _auth.ts              JWT authentication middleware
  _rateLimit.ts         Per-IP rate limiting
  _types.ts             Shared request/response types
  ai-summary.ts         AI insights generation (Gemini/Claude)
  upload-health-markers.ts  Lab PDF parsing & storage
src/
  api/                  Client-side API layer (HealthClient, typed events)
  components/           React UI components
  pages/                App pages (Dashboard, Markers, Trends, Analysis, Settings)
  hooks/                Custom React hooks
  data/                 Reference ranges and optimal ranges databases
  utils/                Formatting, insights, and analytics utilities
  types/                TypeScript type definitions

Getting Started

Prerequisites

Environment Variables

Create a .env file:

# Required
VITE_SUPABASE_URL=https://xxxxx.supabase.co
VITE_SUPABASE_ANON_KEY=eyJ...

# Backend
SUPABASE_URL=https://xxxxx.supabase.co
SUPABASE_SERVICE_KEY=eyJ...

# Optional integrations
GEMINI_API_KEY=AIza...
ANTHROPIC_API_KEY=sk-ant-...

# Security
ALLOWED_ORIGINS=https://your-domain.com
ALLOWED_EMAILS=user@example.com

Installation

npm install
npm run dev

Database Setup

Run the migration files against your Supabase project in order:

  1. supabase_migration.sql — Creates all tables (health_markers, daily_summary, sleep_periods, workouts, body_metrics, heart_rate_samples, app_settings)
  2. supabase_rls_and_cleanup.sql — Enables Row-Level Security policies
  3. supabase_security_fix.sql — Additional security hardening

Running Tests

npm test              # Run all tests once
npm run test:watch    # Run in watch mode

Building for Production

npm run build

The app is self-hosted at https://your-domain.com/ via Docker.

API Endpoints

Endpoint Method Description
/api/upload-health-markers POST Parse and store lab results from PDF text
/api/ai-summary POST Generate AI health insights

All endpoints require authentication via Supabase JWT.

Security

  • Row-Level Security (RLS) on all database tables
  • JWT authentication on every API endpoint
  • Rate limiting per IP address
  • CORS origin whitelist
  • PII stripping from uploaded lab PDFs
  • Optional email whitelist for access control

License

Private project.

About

Personal health lab results dashboard — upload blood test PDFs, track 150+ biomarkers over time, AI-powered health insights

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors