A biomarker insights dashboard that turns lab results into actionable health guidance — built with Next.js, Supabase, and OpenAI.
HealthScore AI takes common blood test biomarkers (glucose, cholesterol, vitamin D, etc.) and gives you:
- A single health score (0–100) that summarizes your overall status
- Color-coded biomarker cards so you can see what's optimal, what needs attention, and what's concerning at a glance
- AI generated insights and recommendations – In plain English (via OpenAI)
You can try it in demo mode (no account needed) or sign up to save your results and track changes over time.
- Scores 8 common biomarkers against optimal ranges
- Generates a health score with clear status indicators (✅ optimal,
⚠️ suboptimal, ❌ concerning) - Works with or without OpenAI — falls back to deterministic rule-based insights if the API key isn't configured
- Uses OpenAI's structured output mode to generate personalized recommendations
- Validates all AI responses to ensure clean, predictable JSON
- Graceful fallback if the API fails
- Upload lab reports in PDF format to automatically pre-fill biomarker values
- Uses OpenAI API to extract the relevant data
- 👉 Try uploading the example PDF:
public/lab_report_example.pdf
- Supabase authentication (email/password)
- Save unlimited analyses to your history
- Row-level security ensures users only see their own data
- Rate limiting on the analysis endpoint (5 requests per 15 minutes per IP)
- Server-side validation of all biomarker inputs
- Proper separation of client/server code (using
'server-only'imports) - Type-safe end-to-end (shared types between frontend and backend)
| Layer | Technology |
|---|---|
| Frontend | Next.js 15 (App Router), React, TypeScript, Tailwind CSS |
| Backend | Next.js API Routes, server-side validation, rate limiting |
| Database | Supabase (Postgres + RLS) |
| Auth | Supabase Auth (email/password) |
| AI | OpenAI API |
- Type safety — shared types (
BiomarkerData,AnalysisResult) flow through client and server - Server-only boundaries — sensitive logic (OpenAI calls, rate limiting) uses
'server-only'imports to prevent client bundling - Graceful degradation — app works fully without OpenAI; AI is an enhancement, not a dependency
- Production patterns — request validation, rate limiting, error handling, RLS policies
git clone https://github.com/amadeuserras/healthscore-ai.git
cd healthscore-ai
npm installCreate a .env.local file (use .env.local.example as reference):
# Supabase (required)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your_supabase_publishable_key
# OpenAI (optional — app works without it)
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini # optional, defaults to gpt-4o-miniRun this SQL in your Supabase SQL editor:
-- Create the history table
create table biomarker_history (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users not null,
health_score integer not null,
biomarker_data jsonb not null,
analysis_results jsonb not null,
created_at timestamp with time zone default now()
);
-- Enable RLS
alter table biomarker_history enable row level security;
-- Users can only see their own records
create policy "Users can view own history"
on biomarker_history for select
using (auth.uid() = user_id);
create policy "Users can insert own history"
on biomarker_history for insert
with check (auth.uid() = user_id);npm run devOpen http://localhost:3000 and try the demo.
- Google login (OAuth) — let users sign in with Google via Supabase Auth (Google provider)
- Trend visualization — line charts showing how biomarkers change over time
- Email notifications — remind users to retest after 3 months
- More biomarkers — expand beyond the core 8 (hormones, inflammatory markers, etc.)
License: MIT

