The Next.js app behind patternflow.work — landing page, the interactive guide (/guide: Build, Play, Make, Audio, in English and Korean), Live Editor, Pattern Lab, the pattern community (on the community host only), browser flasher, edition shelf and feature catalogue, device update handoff, journal, and roadmap.
For how the app is put together (routes, pattern system, content pipeline), see ARCHITECTURE.md.
npm install
npm run dev # http://localhost:3000Other scripts:
npm run build # production build — must pass before merging (CI hard gate)
npm run lint # eslint
npm run typecheck # tsc --noEmit, here and in ../tools/virtual-panel
npm run check:ci # every smoke suite CI runs, then the drift checks (check:module wants the Xtensa toolchain and stays local)
npm run check:drift # the drift checks alone; check:bom, check:editions and the others run one each
npm run check:rest-vectors # a drift check: ../docs/rest-api-vectors against a virtual panel; osc-, midi-, mqtt- and audio-vectors the same
npm run check:virtual-panel # a drift check too, but no vectors: every preset runs two seconds on a virtual panel without throwing
npm run virtual-panel # a Patternflow with no board, until Ctrl-C; on Linux add -- --port http=8080 (../tools/virtual-panel/README.md)
npm run check:human-lock # fails if a word of the maintainer's own writing changed since the merge-base with origin/dev
npm start # serve the production buildRequires Node 20+ (matches CI).
None are required — the site runs fully without them. The community host needs more; .env.example lists every variable, and ARCHITECTURE.md groups them.
| Var | Purpose |
|---|---|
NEXT_PUBLIC_POSTHOG_KEY / NEXT_PUBLIC_POSTHOG_HOST |
PostHog analytics (no-op when absent) |
GITHUB_TOKEN |
Higher GitHub rate limit for /api/roadmap (optional) |
src/app/— routes (App Router)./pattern-labis the pattern workspace (noindex, not internal). The breadboard build guide issrc/app/build/breadboard/page.tsx— React, not markdown. The interactive guide issrc/app/guide/(one page per guide, each with ako/twin) over one 3D stage insrc/components/guide/; its words, in both languages, aresrc/components/guide/copy.ts(Play) andcopy/(the others), and the firmware simulator it runs issrc/lib/guide/.src/components/— 3D viewer, landing sections, journal renderer, the community UI. The build map's pins aresrc/components/sections/InsideGlobe/builds.tsplus photos inpublic/builds/<slug>/. The Build panel's case cards aresrc/components/sections/build-cases-data.tsplus photos inpublic/cases/<id>/(CC BY-SA, resized from the remix's own folder, or for the official case fromdocs/build-guide/); the same folder holds the case's 3D model for the preview,model.glb, built bytools/case-models.src/lib/presets/— JS pattern library; source of truth for the firmware preset headers (firmware/toolchain/check_presets.pykeeps the two in step).content/— markdown/MDX site copy (build.md,pattern.md,inside.md) and the journal. The journal is the maintainer's own writing.public/flash/— esp-web-tools manifest + firmware binaries for the browser flasher (there is no/flashpage: the Flash Patternflow button lives on the Pattern tab and in the Play guide).public/packs/— the Basics pack.public/guide/— the guide's models, its flasher captures, and the live console and editor demos (firmware/toolchain/console_demo.py,editor_demo.py).scripts/— build-time helpers (build-sandbox.ts,import-patterns.ts, ...), the build worker, thecheck:*smoke suites (*-smoke.ts, run withtsx), and the drift checks inscripts/drift/, the contract-vector suites among them;test/setup.ts— the setup for the Vitest component tests that sit beside the code (src/**/*.test.ts(x),npm run check:panels);drizzle/— community DB migrations;.env.example— every variable the community host reads.AGENTS.mdhere is a blocknext devwrites for AI agents;CLAUDE.mdis a one-line shim to it. The project's own agent context is the rootAGENTS.md.
See the repo-level CONTRIBUTING.md. Web changes go through a PR into main; CI runs lint, typecheck, check:ci and build on anything under web/, and the drift checks and check:human-lock on every pull request.
Code in web/ is MIT licensed (LICENSE-MIT).