SummerProject2026/dashboard/README.md

99 lines
3.6 KiB
Markdown

# Utah Vehicle Health dashboard
This directory is a dependency-free static development prototype. It uses
semantic HTML, CSS, vanilla ES modules, and inline SVG generated from approved,
suppressed aggregate JSON. It has no database client, server credential,
analytics SDK, or external CDN.
Every displayed result comes from the private 10,000-vehicle development
sample. Results are sample-based, are not population estimates, and must not be
used for individual decisions. The final prototype model is calibrated logistic
regression; the boosted tree is a benchmark only.
## Run locally
From the Utah Vehicle Health source-repository root:
```bash
node dashboard/server.mjs
```
Open `http://127.0.0.1:4173`. Do not open `index.html` directly with a `file:`
URL; browsers will block the JSON module requests. To use another port:
```bash
PORT=8080 node dashboard/server.mjs
```
## Run a live demo on the same network
From the source-repository root, run:
```bash
node dashboard/server.mjs --lan
```
Stop any older dashboard process with `Ctrl-C` before starting. Or, from this
directory, run `npm run start:lan`. The server prints a **This computer** URL
and one or more interface-labeled **Other devices** URLs. Open the URL for the
shared Wi-Fi or Ethernet interface on the second computer; `0.0.0.0` is a bind
address, not the address to put in a browser. Confirm the in-app status reads
**Validated sample aggregates**, then stop the server with `Ctrl-C` after the
demo.
All data-contract and checksum validation remains enabled over LAN HTTP. When a
remote browser does not expose the SubtleCrypto digest API to the plain-HTTP
page, the dashboard uses its dependency-free SHA-256 implementation and still
rejects changed assets. The checks validate bundle consistency, not the
authenticity of a plain-HTTP connection, so use a trusted demo network.
Run the dependency-free contract checks with:
```bash
node --test dashboard/tests/contract.test.mjs
```
After the contents of `dashboard/` have been copied into a dashboard-only
repository or project root, use the self-contained equivalents:
```bash
npm start
npm test
```
## Public-data boundary
The browser requires and validates these files beneath `public/data/`:
- `data_manifest.json`
- `overview_period_county.json`
- `age_risk_curve.json`
- `cohort_scorecard.json`
- `model_diagnostics.json`
- `coverage_quality.json`
- `filter_catalog.json`
- `sha256_manifest.json`
If any file is missing, malformed, has inconsistent publication flags, or
contains a denied identifier-like field, the dashboard shows an unavailable
state and no estimates. Regenerate assets with the repository's private local
pipeline; never hand-edit public JSON to bypass suppression.
Previously published cohort definitions are frozen against cross-release
differencing. New canonical model families may be added only when the combined
family clears every publication threshold; aliases or trims must not be folded
into an existing public cell. Increment `PUBLICATION_POLICY_VERSION` whenever
an approved aggregation policy changes.
The site intentionally contains no vehicle lookup, individual estimator,
operational connection, or row-level prediction output. VINs, plates, ZIPs,
stations, technician identifiers, raw source JSON, credentials, and operational
records must never enter this directory.
## Public hosting is not required
The delivery path is the same-network live demo. No public URL, dependency
install, or build step is needed. If public hosting is
ever reconsidered, publish only a separately reviewed copy of this dashboard
directory—never the private source repository.