尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证monthly
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Internal executive dashboard that reproduces the healpath_dashboard.pbix Power BI
model as an always-on web app: Next.js (App Router, TypeScript) on Vercel, a
Supabase Postgres backend, and Recharts for the charts.
The app runs immediately against a bundled 2026 snapshot (data/snapshot2026.json),
so every page and filter works before Supabase is wired up. Once the database is
configured the same queries run live against Postgres.
| Route | Page | Shows |
|---|---|---|
/ | Overview | 5 KPI cards, top-5 disease blocks, top-5 active ingredients, avg-per-visit trend |
/diseases | Disease & Diagnosis | ICD-block ranking, block share, searchable drill table |
/pharmacy | Pharmacy | Meds/visit + Δ, top active ingredients, top brands |
/doctors | Doctor & Specialty | Visits by specialty, sortable doctor matrix |
/diagnostics | Labs & Scans | Labs/visit + Scans/visit + Δ, top lab tests, top scans |
/trends | Trends | Multi-line avg per visit by month, dynamic Δ strip |
/login | Login | Supabase email/password authentication |
/users | Users | Admin-only Viewer account management |
/admin/import | Data Import | Admin-only monthly workbook import |
/admin/patient-master | Patient Master | Admin-only patient master import |
/chronic/import | Chronic Import | Admin-only chronic workbook import |
HealPath uses Supabase Auth with two roles:
Navigation visibility, middleware authorization, and server/API checks enforce
the same policy. Disabled Viewer accounts cannot sign in, and authenticated
users receive a dedicated 403 screen for restricted URLs.
All measures come straight from the .pbix, confirmed against the model:
Avg Meds per Visit = DIVIDE(COUNT(Drug_Fact[brand]), DISTINCTCOUNT(Visit[VisitID]))
Avg Labs per Visit = DIVIDE(COUNT(Lab_Fact[Tests]), DISTINCTCOUNT(Visit[VisitID]))
Avg Scans per Visit = DIVIDE(COUNT(Scan_Fact[Tests]), DISTINCTCOUNT(Visit[VisitID]))
Visits = DISTINCTCOUNT(Visit[VisitID])
Patients = DISTINCTCOUNT(Visit[Patient Id])
DAX COUNT on a text column ignores blanks, so the SQL counts non-blank rows.
Month-over-month deltas are computed dynamically (latest month vs the one before
it) rather than hardcoded to fixed month names — so they stay correct as new
data arrives. See lib/queries.ts.
The analytic window is 2026 only (Jan–Jun 2026).
The raw extract has two issues the import step corrects:
month_year is derived from the reliable
Year + MonthName fields, not the corrupt pre-computed column.npm install
npm run dev # http://localhost:3000, runs on the bundled snapshot
.env.example):
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY (server only)DATABASE_URL (server only)supabase/schema.sql once against the Supabase project.supabase/migrations/20260825000100_add_healpath_rbac.sql once.[email protected] in Supabase Auth; the migration trigger
makes it the active primary Administrator. Every other Auth user defaults to
an inactive Viewer and should normally be created from /users.npm run import -- path/to/HealPath_BI_Starter.xlsx
The import script:
month_year from Year + MonthName.visits first, then the four fact tables so the FK holds.visit_id must match
the source workbook before the refresh is considered complete.If reconciliation fails, the dashboard keeps serving the previous data; fix the extract and re-run.
app/ pages + api/ route handlers
components/ KpiCard, BarRank, TrendLine, Donut, DataTable, FilterBar, TrendArrow
lib/ supabase client, queries (the metric library), types
scripts/ import.ts (CSV/XLSX -> Supabase loader + reconciliation)
supabase/ data schema + RBAC migration
data/ snapshot2026.json (bundled fallback data)