尚未偵測到更新。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)