Documentation
Everything you need to customize and ship the dashboard.
Getting Started
Install dependencies and start the Vite dev server:
npm install
npm run dev # http://localhost:5173
Build a production bundle to dist/:
npm run build
npm run preview # serve the built site locally
npm run check # sweep every page in both themes
npm run csp # print a Content-Security-Policy for this build
Tech Stack
A modern, no-framework stack: Vite 8 (multi-page build), plain vanilla JS ES modules, and Tailwind CSS v4 via the @tailwindcss/vite plugin. Reusable page chrome uses Handlebars partials (vite-plugin-handlebars). Charts are ApexCharts, tables are an in-house vanilla datatable (src/js/modules/datatables.js), toasts are Notyf, icons are lucide, and the typeface is Inter via @fontsource-variable/inter. Heavy libraries are lazy-loaded so the initial bundle stays small.
Project Structure
index.html, clinical.html, … # every page is a root .html file
src/
partials/ # head, sidebar, header, scripts (Handlebars)
styles/
main.css # Tailwind v4 + OKLCh design tokens
js/
main.js # entry: boots each feature module
data.js # chart datasets (swap for your API data)
modules/ # theme, sidebar, charts, datatables, …
vite.config.js # auto-discovers root .html pages
Theming & Tokens
All colors are OKLCh CSS variables in src/styles/main.css, defined under :root (light) and again under .dark. Change the primary color, surfaces, chart palette, or clinical status tokens in one place:
:root {
--primary: oklch(0.55 0.09 195); /* clinical teal */
--status-stable: oklch(0.60 0.12 155);
--status-critical: oklch(0.55 0.20 25);
--chart-1: oklch(0.55 0.09 195);
}
Every chart, accent, and clinical status colour also has a -text twin. Fills want a light, vivid colour; the same colour set as small text on a pale tint of itself — the badge and pill pattern used across the template — only reaches about 3.5:1. The twins are the same hue and chroma with the lightness solved so that worst case still clears WCAG AA.
<!-- fill from the base token, text from the twin -->
<span style="background-color:color-mix(in oklch, var(--status-stable) 14%, transparent);
color:var(--status-stable-text)">Stable</span>
<!-- as utilities -->
<span class="bg-primary/10 text-primary-text">SC</span>
Rule of thumb: base token for fills, borders, and chart series; the -text twin for anything with a glyph in it, text or icon. Retune a base colour and you should retune its twin the same way.
Users can switch light/dark, color preset, and density at runtime from the header and Settings → Appearance. Choices persist to the browser and re-apply before paint.
Health check
npm run check builds the site, then opens every page in light and dark and fails on a console error, a failed request, horizontal overflow at 360px, an icon name that is not in the curated set, a missing title or lang, a broken internal link, a bundle over budget, or any serious or critical axe violation against WCAG 2.1 A/AA.
npm run check # everything, both themes
npm run check -- --fast # skip the accessibility pass
npm run check -- --page=patients.html
It drives your installed Chrome through playwright-core, so there is no browser download. Budgets and the theme storage key are configured in the check block of package.json. Run it after you swap in your own content — it is the fastest way to catch a colour pairing that no longer passes.
Security headers
The site is static, but it does carry one inline <script> — the pre-paint theme applier. It has to be inline; a separate file would load after first paint and you would see a flash of the wrong theme. A strict Content-Security-Policy therefore wants its hash rather than 'unsafe-inline'.
npm run csp reads the hash out of dist/ and prints a policy this build satisfies. Add -- --header for a single line you can paste into a server config.
default-src 'self';
script-src 'self' 'sha256-5QKdpEChBAcG8uwEUBe7zk5xYndKRs/vPBuYo6VsCV0=';
style-src 'self' 'unsafe-inline';
img-src 'self' data:;
font-src 'self';
connect-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
The script hash changes when you edit src/partials/head.html — re-run npm run csp and update your header. style-src needs 'unsafe-inline': colour tints are style attributes so they can use color-mix() with the tokens, and ApexCharts and Notyf each inject a <style> element at runtime. connect-src 'self' holds only because the template makes no network calls of its own — widen it once the pages talk to your API. Note that frame-ancestors is ignored inside a <meta http-equiv> tag.
Using Your Own Data
Chart data lives in src/js/data.js; table and list data lives in the relevant module (e.g. modules/appointments.js) or directly in the page markup. Replace these with your own values or a fetch() to your backend, keeping the same shapes.
// src/js/data.js
export const DATASETS = {
admissions: {
categories: ["Mon", "Tue", "Wed", …],
series: [{ name: "Admissions", data: [16, 22, 19, …] }],
colors: ["--chart-1", "--chart-2"],
},
};
Note: the bundled data is fictional and for demonstration only. Do not ship it as real patient information.
Adding a Page
Create a new .html file at the project root — Vite discovers it automatically. Start from the shared partials, then add a link in the sidebar:
<!-- reports.html -->
<head><title>Reports · Clinova</title>{{> head }}</head>
<body class="min-h-screen">
{{> sidebar }}
<div class="flex min-h-screen flex-col lg:ms-[260px]">
{{> header }}
<main class="p-4 sm:p-6">…</main>
</div>
{{> scripts }}
</body>
Then add <a href="reports.html"> to src/partials/sidebar.html.
Charts
Charts are declarative: add a placeholder with data-chart (the type) and data-series (a key in DATASETS). ApexCharts is loaded on demand and re-tinted automatically when the theme changes.
<div data-chart="area" data-series="admissions"></div>
<div data-chart="donut" data-series="triage"></div>
Deployment
npm run build emits a fully static site to dist/ — no server required. Host it on any static host or CDN (Netlify, Vercel, Cloudflare Pages, S3 + CloudFront, GitHub Pages).