πŸ₯– open source Β· MIT Β· zero dependencies Β· Node 18+

doughplan β€” the bake-day planning engine

A small, dependency-free JavaScript library that turns a day of bakery orders into the three things a baker actually needs at 4 a.m.: a time-reversed bake schedule, scaled baker's-percentage formulas, and one aggregated shopping list.

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.

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
πŸ₯– DoughPlan β€” bake day 2026-06-20 32 units Β· 28.00 kg dough Β· 13.98 kg flour Β· out of oven 08:00 ⏱ SCHEDULE (planned backward from out-of-oven) Fri 03:00 PM Feed levain Country Sourdough Γ—24, Seeded Spelt Γ—8 Fri 09:00 PM Autolyse Country Sourdough Γ—24, Seeded Spelt Γ—8 Fri 10:00 PM Add levain, bulk Country Sourdough Γ—24 Sat 04:00 AM Into the fridge Country Sourdough Γ—24 Sat 07:00 AM Preheat Dutch oven Country Sourdough Γ—24, Seeded Spelt Γ—8 πŸ”₯ Sat 08:00 AM Out of the oven Country Sourdough Γ—24, Seeded Spelt Γ—8 πŸ›’ SHOPPING LIST (aggregated across all products) Bread flour 10.77 kg Spelt flour 2.11 kg Whole wheat flour 1.10 kg Water 10.58 kg Sourdough starter 2.80 kg Mixed seeds 362 g Sea salt 280 g

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.