- Svelte 53.5%
- TypeScript 44.9%
- JavaScript 1.1%
- CSS 0.3%
- HTML 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Publish version 0.0.1 as the starting point for release notes. Keep the existing clock and language picker available on the merged site. |
||
| .dagger | ||
| assets | ||
| av-sync | ||
| messages | ||
| project.inlang | ||
| src | ||
| static | ||
| tests | ||
| .eslintignore | ||
| .eslintrc.cjs | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| AGENTS.md | ||
| cliff.toml | ||
| dagger.json | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| svelte.config.js | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| vite.config.ts | ||
Total Tech Test
A browser-based collection of audio, video, input, and device diagnostics. Use it to check a display, speakers, AV synchronisation, or browser-accessible hardware such as cameras, microphones, gamepads, and sensors.
Included tests
- Video: fullscreen test card, AV sync video, display timer, and camera preview
- Audio: stereo and surround channel tests, phase test, signal generator, microphone analyser and recorder
- Controls: keyboard, mouse and multi-touch, and gamepad tests
- Device and network: browser sensors and an embedded internet speed test
The UI is available in English, Spanish, French, German, Simplified Chinese, Japanese, Czech, and Ukrainian.
Getting started
Install Git LFS, Node.js, pnpm, and Dagger v0.21.12 with access to a container runtime.
git lfs pull
pnpm install --frozen-lockfile
pnpm run generate-assets
pnpm run dev
Vite prints the local URL when the development server is ready. Browser permission prompts for cameras, microphones, location, and sensors must be granted before those tests can access the relevant hardware.
Server clock synchronization
The /time screen reads GET /api/time. Vite provides this endpoint during development and preview; the static production build needs the web server to provide it. For Nginx, add this location inside the site's server block:
location = /api/time {
default_type text/plain;
add_header Cache-Control no-store always;
return 200 "$msec";
}
$msec returns Unix seconds with millisecond precision. The endpoint must return a plain numeric body and disable caching so each sample reflects the current server time.
Commands
| Command | Description |
|---|---|
pnpm run dev |
Start the development server. |
pnpm run build |
Create the static production build in build/. |
pnpm run preview |
Serve the production build locally. |
pnpm run check |
Synchronise SvelteKit and run Svelte/TypeScript checks. |
pnpm run lint |
Check formatting and run ESLint. |
pnpm run format |
Apply Prettier formatting. |
pnpm test |
Run the Vitest suite once. |
pnpm run generate-assets |
Generate media assets with Dagger. |
pnpm run av:dev |
Start the AV-sync asset development app. |
pnpm run av:render:video <args> |
Render the AV-sync video asset. |
pnpm run av:render:audio |
Render the AV-sync audio asset. |
Dagger builds
Run this command from the repository root to export the complete static site.
dagger call site --source . export --path build
Dagger installs dependencies from pnpm-lock.yaml with --frozen-lockfile and generates the speaker test tracks and all three AV-sync videos. Run git lfs pull before building to fetch the source WAV files. The Dagger build uses its own Node.js installation.
In a regular checkout, the build reads Git history from the checkout automatically. For a linked worktree, pass a bundle because its .git file points to metadata outside the worktree:
history_dir=$(mktemp -d)
git bundle create "$history_dir/test-card-history.bundle" HEAD --tags
dagger call site --source . --git-history "$history_dir/test-card-history.bundle" export --path build
rm -rf -- "$history_dir"
The bundle carries the current commit and release tags without Git configuration or remote URLs. GitLab CI fetches full history and uses the same bundle input. Source exports without Git metadata still build; their release notes show the unavailable message.
Release notes start empty at version 0.0.1. After merging the baseline into main, tag that commit v0.0.1 and push the tag to origin. Eligible commits after that tag appear under Unreleased until they are tagged with a later release.
To export just the generated media for local development, run:
dagger call assets-generated --source . export --path assets/generated
Version bumps
Run the bump from a clean, up-to-date main after the v0.0.1 baseline tag is in place.
npm run version:bump -- patch
git push origin main v0.0.2
The script updates package.json and creates a local release commit and matching tag. Use minor, major, or an explicit version in place of patch when appropriate. For later releases, push the tag the script reports. If GitLab builds main before the mirror has the tag, start a fresh main pipeline once the tag is visible.
GitLab CI and deployment
The GitLab mirror builds on pushes to main. You can also start a pipeline in the GitLab UI to test a branch that has the CI configuration. Use a project runner that picks up untagged Docker jobs and mounts /var/run/docker.sock. The runner must be able to start Dagger v0.21.12 or connect to a compatible engine. The engine needs network access to the SSH target for deployment.
Protect main in GitLab. Set SSH_TARGET to the rsync destination, for example web:/var/www/site/, under Settings → CI/CD → Variables. Use a protected, masked variable scoped to production with variable expansion disabled.
Under Settings → CI/CD → Secure Files, upload SSH_CONFIG with the SSH client configuration, SSH_UPLOAD_KEY with the private deploy key (including its final newline), and SSH_KNOWN_HOSTS with the verified SSH host keys. The deploy job downloads these uploads by their GitLab file IDs. Update the corresponding ID in .gitlab-ci.yml when replacing an upload.
Pipelines on protected main deploy automatically after build_site succeeds. The deploy job passes that pipeline's build/ artifact to Dagger's deploy function.
Testing
The test suite uses Vitest. The visual regression test starts a Vite server on port 5888, captures /card with Puppeteer, and compares it with tests/fixtures/testcard-baseline.png.
pnpm test
A deliberately updated visual baseline can be regenerated by deleting the fixture and rerunning the relevant test:
rm tests/fixtures/testcard-baseline.png
pnpm exec vitest --run tests/test-card.test.ts
Screenshots and visual diff artifacts are written to tests/output/, which is ignored by Git.
Project structure
src/routes/— SvelteKit routes for each diagnosticsrc/lib/— reusable Svelte components, including the test card and audio visualisersmessages/— translated Paraglide message filesassets/generated/— generated AV assets; do not edit by handav-sync/— source and render scripts for AV-sync mediatests/— Vitest functional and visual regression tests
Development notes
This is a SvelteKit, Svelte 5, TypeScript, Vite, and Tailwind CSS application. It is statically prerendered, with trailing slashes enabled. Formatting is enforced by Prettier and linting by ESLint. See AGENTS.md for repository conventions and validation guidance.