Docs

Contributing to Recipe Bank.

Three things people add most: a recipe, a video platform, a feature. Each has a small, fixed path through the code.

Ground rules

  • No dependencies. Plain ES modules, Node.js 22 or newer, no framework. Adding a build step is a decision to raise with the owner first.
  • Tests come with the change. They run on Node's built-in test runner: npm test.
  • Escape every string from data. Recipe files and looked-up video titles come from third parties. The dashboard passes each one through esc() before it reaches the page.
  • Browser storage holds conveniences only. Each read and write is wrapped so that blocked storage never breaks a page.
  • The recipe contract is the source of truth. lib/recipe.mjs decides what a valid recipe is.

Add a recipe

  1. Read the recipe format, or keep the cheat sheet next to you.
  2. Write recipes/<id>.json from the video, by hand or with the Recipe Agent. Use the creator's amounts, your own words for the method, and reuse ingredient keys that exist.
  3. Credit the creator by name and link, and link the original video.
  4. Run npm run validate.
  5. Remove the matching entry from data/queue.json if there is one.
  6. Keep captions, transcripts and frames out of the change.

Three recipes are shown on the home page of this website: cold-pan-chicken, air-fried-chicken-nuggets and banana-milk. After editing one of them, run npm run site:data, or npm test fails.

Add a platform

Everything the project knows about a video platform is in one file, lib/video.mjs, which the server, the validator and the browser share. It must stay free of dependencies and of browser-only code.

FunctionWhat to add
parseVideoUrlRecognise the platform's links and return its platform name, the video id and one canonical url. Return nothing for links that are not a video.
embedUrlThe address of the platform's own player, or nothing when it has none. Videos are embedded from the platform, never re-hosted.
thumbnailUrlA poster image only when the platform has a stable public one.
videoKeyUsually nothing: it builds the key that finds duplicates from the platform and the id.
  1. Add cases to test/video.test.mjs for every link shape you accept, and for look-alike links you reject.
  2. Add the platform's row to the PLATFORMS table in lib/video.mjs. The validator's message that names the supported platforms, and the dashboard's platform labels, are built from that table.
  3. Add the platform's label to the showcase of this website in site/js/showcase-core.js, which keeps its own list.
  4. If the platform has a public title lookup, the server can use it when a video is queued. A queue entry works without a title.

Shipped This is on the main branch today.

The note above is about support for Facebook, Pinterest, X and opted-in web pages. Look at how that work is laid out before you add another platform, so yours follows the same pattern: one row in the PLATFORMS table, the parsing in lib/video.mjs, and docs/PLATFORMS.md.

Add a feature module

Shipped This is on the main branch today.

The note above is about the redesigned dashboard, which is what makes feature modules possible: a feature plugs in without editing the dashboard's own code. The contract is written down in docs/design/MOUNT-POINTS.md; this is the short version.

  1. One module. A feature is one ES module in public/features/ that exports install(rb), registered in public/features/index.js. A feature that fails to load is skipped, and the dashboard carries on.
  2. Mount points. The dashboard renders empty, named elements and leaves them alone: in the header, above the grid, in the filter panel, on each card, and on the recipe page. A feature fills the ones it needs each time the view is drawn.
  3. Events. The dashboard announces what happens: a view was drawn, the grid was redrawn, the filters changed, an ingredient was ticked, cook mode opened.
  4. Filters and routes. A feature can register a recipe filter, and a page of its own with one of the three layout types: list, detail or message.
  5. Logic apart from the page. Pure logic goes in lib/ with tests, so it runs without a browser.

Rules a feature must keep:

  • Use the design tokens and the existing components. Controls are at least 44 px on phones, and nothing depends on hover.
  • Never change a recipe's data. A scaled amount is a display value, marked as scaled, with the creator's original still shown. An unstated amount never gets a number.
  • Escape strings from recipes and the queue, and use the storage helper that never throws.

Change this website

The website lives in site/ and is separate from the dashboard. Its rules are in site/README.md. The two that matter most:

  • Only true things. Every feature the site names is an entry in site/data/features.json with a status: shipped, next or planned. When something merges, change its status there and run npm run site:sync. The home page and the status notes in these docs follow.
  • Every page works without JavaScript. Scripts add the filter, the theme switch and the animated mark. They never hold content.

Send it

  1. Run npm run validate and npm test.
  2. Open a pull request on GitHub that says what changed and how you checked it.
  3. For a recipe, say what you looked at: the captions, the description, the frames.

The code and the recipe files are MIT licensed. The videos belong to their creators.

NextChangelog