A React webapp for searching and browsing the HDS data model — items, streams, eventTypes, settings.
Replaces the static HTML tables previously published at model.datasafe.dev/index.html.
npm run setup # installs deps + clones gh-pages branch into dist/
npm run dev # http://localhost:8090| Script | What it does |
|---|---|
npm run dev |
Vite dev server on port 8090 |
npm run build |
Production build to dist/ |
npm run preview |
Preview the built app |
npm run test |
Run vitest suite |
npm run lint / lint:fix |
ESLint |
npm run typecheck |
tsc --noEmit |
npm run setup |
Install deps + set up dist/ as gh-pages checkout |
npm run deploy |
Build + push to gh-pages (must be on main, clean tree) |
hdsLibService honors two Vite env vars:
| Var | Effect |
|---|---|
VITE_MODEL_URL |
Load pack.json directly from this URL, bypassing service-info |
VITE_SERVICE_INFO_URL |
Use this service-info instead of the hds-lib default |
Example — point at a locally-built data-model/data-model/dist/pack.json:
VITE_MODEL_URL=http://localhost:8000/pack.json npm run dev- React 19 + Vite 6 + Tailwind 4 + SWC — same stack as
hds-webappandhds-forms-js. hds-lib—HDSModelloader; data is fetched frommodel.datasafe.dev/pack.json(or the local override).hds-forms-js— re-usesItemSearchPicker,getItemGroup, andrepeatableLabeldirectly. No vendoring.hds-style— base theme variables.
src/
App.tsx Top-level layout, tab switcher, model loader
main.tsx React root
index.css Tailwind + hds-style imports
services/
hdsLibService.ts HDSModel singleton initializer (with env-var overrides)
components/
Tabs.tsx Minimal tab switcher
ItemsTab.tsx Items panel: search picker + detail
ItemDetail.tsx Full item view (label/desc with language picker, etc.)
StreamsTab.tsx Streams panel: tree + items-for-stream
StreamTree.tsx Collapsible stream hierarchy
RawJson.tsx Expandable raw-JSON inspector
Fetches https://model.datasafe.dev/pack.json at startup via initHDSModel(). The JSON files (pack.json, items.json, streamsTree.json, …) are produced by the data-model repo's build pipeline and deployed independently — this app is purely a UI layer, no copy of the model is bundled.
npm run setup # only once
git checkout main
npm run deployLives at https://healthdatasafe.github.io/app-data-model-browser/
The deploy script:
- Refuses to run unless on
mainwith a clean tree - Builds via
npm run build - Writes
dist/version.json(commit SHA + build date) - Touches
dist/.nojekyllso GitHub Pages serves Vite assets - Commits + pushes
dist/(agh-pagescheckout)