Public
Skyrim-style perk tree for the group-chat greens recipe
foodfunui
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

The Greens Tree 🌿

https://greens-tree.val.run

A skill tree for one plate of stir-fried greens. You unlock nodes by cooking them, not by having ingredients. Recipes render as Tabular Recipe Notation — Michael Chu's Cooking for Engineers format: ingredients down the left, each column an operation, cells merged across exactly what they combine.

Rendering mermaid diagram...

Node states: locked (dim), unlocked (hollow, glowing), cooked (gold, ticked). Progress lives in localStorage under greens-tree-cooked-v2.

Structure

  • main.tsx — Hono entrypoint. Shell, /frontend/* via serveFile, /source.
  • frontend/tree.ts — content: ingredient rows, operations, the greens ladder, the nodes.
  • frontend/table.ts — the TRN layout engine (operation graph → merged-cell grid).
  • frontend/app.ts — constellation, progression state, table + legend + ladder rendering.
  • frontend/style.css — dark constellation look, sticky-first-column scrolling table.

How a recipe is built

A node stores adds: [opIds] and inherits every op from its req ancestors, so each recipe is complete and each detail is written exactly once. table.ts then walks the ops in phase order, tracking named streams (greens, pan, garlic): each op merges the streams it consumes plus the ingredient rows it introduces, spans those rows, and produces a stream at the next column. Inherited ops render dimmed; newly added ones get a new tag.

The greens ladder

LADDER in tree.ts maps every green to the stage it enters at — aromatics, hard stems, sturdy leaves, fast greens, off-the-heat herbs. The table's ingredient rows are those categories, so staging is visible in the layout rather than buried in prose.

Editing

Add an op to OPS (give it a phase, an action for the cell, text for the legend, the ing rows it brings, and its consumes/produces streams), then list its id in a node's adds. Nodes need tier and x/y on the 1000×700 canvas, y matching the tier row in TIERS. optional draws a dashed non-gating edge. | in name is a line break. Non-cooking nodes (the shop quest, the chili-oil component) use override + overrideIng.