Skip to content
Ludofabriko

Local development

  • Node 22.13 or newer.
  • pnpm 11. The repository pins the version in packageManager.
  • Access to the Web Awesome Pro registry. The scope mapping is in .npmrc; the credentials belong in your own ~/.npmrc and are never committed.

From the repository root:

Terminal window
pnpm install

There are two packages: app (the client, the Worker and the request schemas) and docs (this site).

Terminal window
pnpm dev

That builds the client and the Worker and starts wrangler dev. The port is fixed at 3000 and the server binds to all interfaces, because the home lab nginx proxy for ludofabriko.thedragonland.net forwards to http://dart:3000. Opening that hostname reaches the local dev server from outside the machine.

The docs are not part of that dev loop. They are built into the application’s asset output, and they are built by hand only when they change (pnpm docs:build), so pnpm dev shows the last docs build, or nothing under /docs if one has never been made. A missing docs build no longer stops the app from starting; only a production build insists on it.

Terminal window
pnpm docs:dev

Astro serves on port 4000. Because the site is built with base: '/docs', the URL is http://localhost:4000/docs/, not the server root.

Terminal window
pnpm docs:build # documentation only
pnpm build # docs, then the application

The application build copies the finished docs into app/output/client/docs, so one Worker serves the signpost at /, the studio at /app/ and the docs at /docs. Building the docs by hand is deliberate: there is no watcher on them, and the phased-in rule is to rebuild when the source changes.

Terminal window
pnpm test

Tests use Aegis with the Cloudflare helpers. The schemas are stored as Joker JSON files, so the tests load those files from disk and compile them the same way the build does. Two files describe Worker responses and one describes the backup file’s envelope; the rest pin the client’s own rules — field validation, the refusal to store a document the open path would reject, and how a project path names its view and its component. A component’s row keys are the project’s own field ids, so they are checked by hand in lib/projects.js rather than by the schema.

The docs and the studio share one domain: this site is served under /docs, the studio under /app/, and / is a signpost that describes the studio and points at both. Open the studio.