Why it exists
You don't plan a bake day forward from when you wake up β you plan it backward from when the bread has to be out of the oven for market. Three breads, two ovens, twenty-six loaves, one fridge: the math of when to feed the levain and how much flour to buy is fiddly and easy to get wrong on paper. doughplan does it deterministically.
- Baker's percentages done right β flour is always 100%; every formula scales linearly and conserves mass exactly.
- Time-reversed scheduling β every step is an offset before out-of-oven, so one formula produces a real wall-clock plan for any target time.
- Cross-product aggregation β bake three products on one day and get a single merged schedule and one combined shopping list.
Install
# Install straight from GitHub (zero dependencies, Node 18+):
npm install github:SaschaHeyer/doughplan
# β¦or clone and run the CLI directly:
git clone https://github.com/SaschaHeyer/doughplan
cd doughplan && node bin/cli.js --help
Quick start
One call β buildPlan() β takes your formulas (the "menu") and the day's orders, and returns the full plan:
import { buildPlan } from "doughplan";
const plan = buildPlan({
products: [{
name: "Country Sourdough",
unitWeightG: 900, // raw dough weight per loaf
ingredients: [
{ name: "Bread flour", pct: 100, isFlour: true, allergen: "Wheat" },
{ name: "Water", pct: 75 },
{ name: "Sourdough starter", pct: 20, allergen: "Wheat" },
{ name: "Sea salt", pct: 2 },
],
schedule: [ // minutes BEFORE out-of-oven
{ label: "Feed levain", offsetMin: 720 },
{ label: "Mix & start bulk", offsetMin: 600 },
{ label: "Shape", offsetMin: 240 },
{ label: "Out of the oven", offsetMin: 0, bake: true },
],
}],
orders: [{ date: "2026-06-20", items: [{ product: "Country Sourdough", qty: 24 }] }],
date: "2026-06-20",
bakeTime: "08:00",
});
plan.totals; // { units: 24, doughG: 21600, flourG: 10964.5β¦ }
plan.shopping; // [{ name: "Bread flour", grams: β¦ }, { name: "Water", β¦ }, β¦]
plan.schedule; // time-reversed, merged steps with wall-clock times
Worked example (CLI)
The repo ships an examples/bakery.json (two products β Country Sourdough and Seeded Spelt β and a day of orders). Running the bundled CLI against it produces a complete, accurate bake plan:
node bin/cli.js plan examples/bakery.json --date 2026-06-20 --time 08:00
API
buildPlan({ products, orders, date, bakeTime })
The one-call entry point. Aggregates orders for date, scales every product, merges a time-reversed schedule anchored to bakeTime, and returns { date, outOfOven, productLines, formulas, shopping, schedule, totals }.
scaleProduct(product, units)
Scales one product to units finished loaves and returns grams per ingredient. Mass-conserving: flour weight = doughTotal Γ 100 / totalPct.
hydration(ingredients)
Water (and other liquids) as a percentage of flour weight β the number bakers quote, computed from the formula.
totalPct(ingredients)
Sum of every ingredient percentage (e.g. 197% for a 75%-hydration loaf) β the scaling denominator.
flourPct(ingredients)
Sum of the flour percentages (the 100% basis β can be split across several flours).
allergensOf(product)
De-duplicated allergen list declared across a product's ingredients (handy for cottage-food labels).
buildSchedule(productLines, outOfOven)
Merges every product's steps into one time-ordered schedule; tasks in the same 5-minute bucket with the same label collapse to a single line.
Don't want to write JSON?
This library is the production-math core behind DoughPlan β the back-of-house planning app for home & micro bakeries (20β150 loaves/week). The full visual planner adds order entry, cottage-food labels, per-order packing lists, multi-bake-day planning, printable production sheets and shareable plan links, all in the browser β no install.
Open the free planner at doughplan.com β
Free tools that pair with this library: the baker's-percentage calculator, the sourdough starter calculator, and the dough temperature (DDT) calculator.
License
MIT β read it, trust it, build on it. Issues and PRs welcome on GitHub.