Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯– doughplan

The open-source bake-day planning engine for sourdough & micro bakeries.

Turn a day's orders into the three things you actually need at 4 a.m.: a time-reversed bake schedule, scaled baker's-percentage formulas, and one aggregated shopping list. Zero dependencies, pure functions, MIT licensed.

This is the production-math core behind DoughPlan β€” the back-of-house planning app for home & micro bakeries (20–150 loaves/week). The engine is open source so you can read it, trust it, and build on it. If you'd rather not write JSON, the full visual planner (labels, packing lists, multi-bake-day, printable production sheets & shareable plan links) lives at doughplan.com.

πŸ“– Docs & live API reference: saschaheyer.github.io/doughplan


Why this 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 the same 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

Requires Node 18+. No dependencies.

CLI

doughplan 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 + salt      ...
   Sat 04:00 AM     Into the fridge        ...
   Sat 07:00 AM     Preheat Dutch oven     ...
πŸ”₯ Sat 08:00 AM     Out of the oven        Country Sourdough Γ—24, Seeded Spelt Γ—8

βš–οΈ  FORMULAS
Country Sourdough Γ—24  (75% hydration Β· Wheat)
     Bread flour      90%   9.87 kg
     Water            75%   8.22 kg
     ...

πŸ›’  SHOPPING LIST (aggregated across all products)
     Bread flour      10.77 kg
     Water            10.58 kg
     ...

Pipe it from anywhere:

cat bakery.json | doughplan plan --date 2026-06-20

Library

import { buildPlan, scaleProduct, hydration } from "doughplan";

const 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: "Starter",     pct: 20, allergen: "Wheat" },
    { name: "Sea salt",    pct: 2 },
  ],
  schedule: [                               // offsetMin = minutes BEFORE out-of-oven
    { label: "Feed levain", offsetMin: 600 },
    { label: "Mix",         offsetMin: 540 },
    { label: "Shape",       offsetMin: 240 },
    { label: "Bake",        offsetMin: 45, bake: true },
    { label: "Out of oven", offsetMin: 0,  bake: true },
  ],
}];

const orders = [
  { date: "2026-06-20", items: [{ product: "Country Sourdough", qty: 24 }] },
];

const plan = buildPlan({ products, orders, date: "2026-06-20", bakeTime: "08:00" });

plan.totals;     // { units: 24, doughG: 21600, flourG: 10964.5 }
plan.schedule;   // [{ at: Date, label, bake, items: [{product, units}] }, ...]
plan.formulas;   // [{ product, units, hydration, allergens, ingredients: [{name, pct, grams}] }]
plan.shopping;   // [{ name, grams, isFlour }, ...] aggregated across products

API

Function Returns
buildPlan({ products, orders, date, bakeTime }) full plan: schedule, formulas, shopping, totals
scaleProduct(product, units) ingredient grams for N units (mass-conserving)
buildSchedule(productLines, outOfOven) merged, time-ordered schedule
hydration(ingredients) water as a % of flour
totalPct(ingredients) / flourPct(ingredients) percentage sums
allergensOf(product) de-duplicated allergen list

Data shapes are documented as JSDoc in src/index.js.

How the math works

For a product at unitWeightG Γ— units, total dough weight is known. Because the baker's percentages sum to totalPct (e.g. 197% for a 75%-hydration loaf), flour weight is doughTotal Γ— 100 / totalPct, and each ingredient is flourWeight Γ— pct / 100. Mass is conserved to the gram. The schedule anchors every step to outOfOven βˆ’ offsetMin, then merges steps from different products that fall in the same 5-minute window. See src/bakers-percentage.js and src/schedule.js.

Tests

npm test     # node --test, zero deps

Roadmap

  • Levain build sub-schedule (feed ratios β†’ ready time by temperature)
  • Cottage-food label generator (allergens, net weight, producer info)
  • CSV/ICS export of the schedule
  • Per-order packing lists

PRs welcome. If you run a bakery and the model doesn't fit how you work, open an issue β€” that feedback shapes the hosted product too.

The hosted app

doughplan is the engine. DoughPlan is the full product built on top of it β€” a visual planner with order entry, printable cottage-food labels, packing lists, multi-bake-day planning, printable production sheets, and shareable plan links, priced for micro bakeries (not the $200–350/mo enterprise tools). Free tools you can use right now, no signup:

License

MIT Β© DoughPlan

About

πŸ₯– Open-source bake-day planning engine for sourdough & micro bakeries: time-reversed bake schedule, scaled baker's-percentage formulas & aggregated shopping list. The engine behind doughplan.com.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages