Repository navigation
Development
Working on the dashboard: the scripts, what CI enforces, and the state of the test suites.
pnpm install
pnpm dev
pnpm dev runs Next with --max-old-space-size=4096; some of the report pages
are large enough that the default heap is tight. Use pnpm dev:profile to run
the dev server under the Node inspector.
In development, requests to localhost, 127.0.0.1 and 0.0.0.0 bypass
authentication in the middleware, so you can work against a real API without any
identity provider configured. Only API_BASE_URL and a credential are needed —
see Configuration.
| Command | What it does |
|---|---|
pnpm dev |
Dev server on port 3000 |
pnpm build |
Production build, standalone output |
pnpm start |
Serve a production build |
pnpm lint |
ESLint with --max-warnings=0
|
pnpm test |
Jest |
pnpm test:e2e |
Full Playwright run |
pnpm test:routes |
Playwright, page smoke tests only |
pnpm test:api-health |
Playwright, health checks only |
pnpm test:api-endpoints |
Playwright, API contract checks only |
pnpm test:api-prod / pnpm test:all-prod
|
The same with TEST_ENV=production
|
pnpm generate-icons |
Regenerate favicons and PWA icons from the logo |
.github/workflows/ci.yml runs on pushes and pull requests to main, on Node 20
with pnpm 9: pnpm install --frozen-lockfile, then four blocking steps in
order.
pnpm exec tsc --noEmit
pnpm lint
pnpm test
pnpm build
Typecheck, lint (warnings included) and unit tests are real gates because
next build checks neither types nor lint: next.config.mjs sets
typescript.ignoreBuildErrors and eslint.ignoreDuringBuilds. Run the first
three locally before pushing.
.github/workflows/ghcr-publish.yml publishes the container image on a tag; see
Deployment.
Unit (Jest) runs every src/**/*.{test,spec}.{ts,tsx} file in a jsdom
environment, with @/ mapped to src/. The suites cover the installs status
and system-problem helpers, device status (including Storage), Cimian version
parsing, the installs last-run verdict, event links and payload details,
installed-update search and KB coverage, the platform filter provider, and a
render test of the managed-installs table.
End-to-end (Playwright) has four projects in e2e/:
| Project | Spec | Checks |
|---|---|---|
frontend-routes |
frontend-routes.spec.ts |
Every page returns under 500, and the legacy /devices/<module> redirects land on /<module>
|
api-health |
api-health.spec.ts |
Calls reportmate-api directly at API_BASE_URL (required) with API_INTERNAL_SECRET or REPORTMATE_PASSPHRASE: health, devices, events, and that an anonymous negotiate call is refused |
api-endpoints |
api-endpoints.spec.ts |
The dashboard's own route handlers (/api/healthz, /api/version and the proxies) |
dashboard |
dashboard.spec.ts |
Dashboard behaviour |
Locally, Playwright starts pnpm dev for you and reuses an existing server on
port 3000. With TEST_ENV=production it skips that and uses E2E_BASE_URL.
Device routes use TEST_DEVICE_SERIAL, defaulting to TESTSERIAL0001. CI does
not run the Playwright suites.
- TypeScript
strict, path alias@/*mapped to the repo root intsconfig.json. - ESLint extends
next/core-web-vitalsandnext/typescript. Unused variables prefixed with_are allowed;src/lib/modules/**is ignored. - Follow
URL_STATE_CONVENTIONS.mdwhen adding filters or list state — see Theming and UI. - New per-module normalization goes in
src/lib/data-processing/modules/, one file per module. - A new data path is a route handler in
app/api/**usinggetInternalApiHeaders(), never a browser fetch to the API.
Branch off origin/main as <type>/<slug> where type is one of feature,
fix, chore, ci, docs. Commit subjects are plain imperative prose. Work is
tracked as GitHub issues in this repository; close them from a pull request body
with Closes #<n>. Never push main directly. Say in the pull request what you
built and ran, including pre-existing failures you did not cause.
docker-compose.yml and pnpm-workspace.yaml describe a monorepo layout
(apps/www, database) that this repository does not have, and deploy.md
documents deployment scripts that are not in the tree. src/api/** has no live
callers.
AGPL-3.0 · reportmate.app