尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
Apple Health analytics dashboard with an AI training coach: streaming export.zip import, sleep/heart/activity trends, iOS-style UI. Next.js 15, Prisma, PostgreSQL, Vercel AI SDK.
翻譯準備中
正在載入完整 README。
檢視完整 README ↗Apple Health analytics with an AI training coach. Import your iPhone's full Health export (or stream it daily from an iOS automation) and get iOS-style dashboards for heart rate, HRV, sleep stages, activity patterns and workouts, plus a coach that plans running and strength sessions from your actual recovery data.
Live demo: ez-health-six.vercel.app (generated demo data; the AI chat is switched off on the public demo)
Screenshots use the built-in generated demo data (
npm run demo:import), not real health records.
export.zip is unzipped and parsed as a stream (SAX) in a Web Worker, and only the compact parsed records are uploaded, in batches of 3 MB at most, under Vercel's 4.5 MB request limit. The same parser runs the CLI import, where a 1.38M-record export takes about 58 s while memory stays around 32 MB (it was 678 MB before source strings were interned).unnest() + ON CONFLICT, thousands of rows per statement, so re-importing the same file or re-sent webhook windows update data instead of duplicating it.| Summary | Summary (dark) |
|---|---|
| Heart & Breathing | AI Coach |
| Workouts & Trends | Import |
| Sleep & Recovery in Hebrew | Summary in Hebrew, iPhone |
|---|---|
| Page | What it shows |
|---|---|
| Summary | Readiness, sleep score and the latest reading of each metric |
| Heart & Breathing | Resting vs workout heart rate, HRV, respiratory rate; 7/30/90-day trend verdicts |
| Sleep & Recovery | Last night's stage timeline, bedtime/wake schedule, stages per night, sleep score, consistency |
| Workouts & Trends | Fitness & recovery trend evaluator (7/30/90 days), weekday × hour activity heatmap, side-by-side workout comparison |
| AI Coach | Rule-based readiness + a chat coach (OpenAI or Gemini via the Vercel AI SDK) |
All scores are documented where they're computed: src/lib/analytics/ (trend.ts, sleep.ts, readiness.ts) and src/lib/queries/evaluation.ts. The coach's summary is built in src/lib/coach/snapshot.ts.
flowchart LR
A["iPhone Health export<br/>export.zip / export.xml"] -->|"/upload"| P["In-browser Web Worker:<br/>streaming unzip + SAX parser"]
B["Health Auto Export app<br/>(daily automation)"] -->|"POST /api/health-ingest<br/>x-api-key"| Z["Zod validation<br/>+ normalisation"]
P -->|"POST /api/import<br/>batches ≤ 3 MB, zod-validated"| S["Idempotent bulk upserts<br/>(unnest + ON CONFLICT)"]
Z --> S
S --> DB[("PostgreSQL<br/>Prisma 7")]
DB --> Q["Query + analytics layer<br/>trends, scores, de-dup"]
Q --> UI["Server-rendered dashboards<br/>Recharts"]
Q --> C["Coach snapshot"] --> LLM["OpenAI / Gemini<br/>Vercel AI SDK"]
Stack: Next.js 15 (App Router, Server Components, route handlers), React 19, TypeScript, Tailwind CSS v4, Motion, Recharts, Lucide, Prisma 7 with the pg driver adapter, PostgreSQL (local Docker, Supabase or Prisma Postgres), zod, saxes, jszip, Vercel AI SDK.
以上為 README 的開頭部分。其餘內容請閱讀原文。 檢視完整 README ↗