How the Crumbloom Engine Works
Most company software is built in disconnected silos: marketing on WordPress, customer ordering on Shopify, kitchen tickets on thermal POS, and packaging in Adobe Illustrator. Crumbloom is built as a single monolithic TypeScript kernel where 72 distinct operational surfaces render purely from shared tokens, pure domain functions, and physical frames.
1. The Kernel Architecture: One Source, Ten Wings
The dependency graph below illustrates how atomic tokens in src/kernel/tokens.ts flow unidirectionally through shared frames into all ten commercial and physical wings.
2. Pure Domain Logic: deriveBakeList
Per CONVENTIONS.md §7, domain functions must have zero side-effects. The bakery hearth schedule is calculated strictly from input arguments without querying globals or mutable clocks:
export function deriveBakeList(
orders: readonly CakeOrder[],
subscriptions: readonly StandingSubscription[],
parLevels: readonly ParLevel[],
now: Date,
): BakeListRow[] {
const tomorrow = addDays(now, 1)
// Monday closure rule: bakery is closed on Mondays, zero bake list
if (getDay(tomorrow) === 1) {
return []
}
const tomorrowDateStr = format(tomorrow, 'yyyy-MM-dd')
// 1. Tally pre-orders due tomorrow
const preOrderCounts: Record<
string,
{ count: number; eggless: boolean; station: string; unit: string }
> = {}
for (const order of orders) {
const isTomorrow =
order.pickup.date === tomorrowDateStr ||
(order.pickup.slot && order.pickup.slot.toLowerCase().includes('tomorrow'))
if (isTomorrow) {
const spongeName =
FLAVOUR_TO_SPONGE_NAME[order.flavour] ?? `${order.flavour} Sponge`
const spongesNeeded = Math.max(1, order.tiers)
const isEggless = order.egg === 'eggless'
const existing = preOrderCounts[spongeName] ?? {
count: 0,
eggless: isEggless,
station: 'Cake Station',
unit: 'sponges',
}
existing.count += spongesNeeded
if (isEggless) existing.eggless = true
preOrderCounts[spongeName] = existing
}
}
// 2. Tally active standing subscriptions
const subscriptionCounts: Record<string, number> = {}
for (const sub of subscriptions) {
if (!sub.isPaused && !sub.isTomorrowSkipped) {
subscriptionCounts[sub.item] =
(subscriptionCounts[sub.item] ?? 0) + sub.quantity
}
}
// 3. Merge with station par levels (floored by statutory buffer)
const rows: BakeListRow[] = []
for (const par of parLevels) {
const preOrders = preOrderCounts[par.item]?.count ?? 0
const subCount = subscriptionCounts[par.item] ?? 0
const demand = preOrders + subCount
const totalQuantity = Math.max(par.parLevel, demand)
const eggless = par.eggless ?? preOrderCounts[par.item]?.eggless ?? false
rows.push({
id: par.item.toLowerCase().replace(/[^a-z0-9]+/g, '-'),
station: par.station,
item: par.item,
preOrders,
subscriptions: subCount,
parLevel: par.parLevel,
totalQuantity,
unit: par.unit,
eggless,
})
}
return rows
}3. The 72-Artifact Manifest Schema
Every artifact across all ten wings is declared in src/kernel/manifest.ts. Descriptions are strictly capped at 90 characters to guarantee grid uniformity.
id: string & name: string
Kebab-cased unique identifier matching URL route and registry key.
wing: WingId
One of 10 commercial categories: identity, print, packaging, ops, etc.
frame: FrameType
Device, Paper, Dieline, Deck, Garment, Elevation, or Inbox chrome.
blurb.length ≤ 90
Automated unit test assertion ensures zero card height distortion.
4. The 16 Frame Components
Physical frames transform on-screen React components into tangible artifacts with calibrated real-world dimensions and printer marks.
| Frame Component | Export Type | Physical Medium & Geometry | Canonical Use |
|---|---|---|---|
| PaperFrame | Container | A4, A5, Visiting Card, 80 mm Thermal Continuous | Thermal receipts, letterheads, menu cards |
| DeviceFrame | Container | Phone (375 × 812), Tablet (1024 × 768) | Customer ordering app, 72h kitchen board |
| DielineFrame | Container | Packaging dielines with bleed margins and registration | 1 kg cake box, brownie sleeves, cookie pouches |
| DeckFrame | Container | 16:9 Presentation slide aspect with slide scrubber | FOFO Franchise kit, investor presentation |
| GarmentFrame | Container | Front & Back garment elevation with embroidery marks | Bakers apron, counter staff tee, rider jacket |
| ElevationFrame | Container | Architectural millwork elevations in mm | Pickup cubby shelf, shopfront fascia, menu board |
| InboxFrame | Container | Email client chrome with 600px desktop & 360px mobile | Welcome email, Diwali corporate blast, review request |
| IsoPlan | Spatial View | 30° Isometric architectural floorplan grid | Sector 56 kiosk plan, DLF Phase 4 café layout |
| IsoBox | 3D Simulation | Pure CSS 3D folded packaging preview with shadows | Folded cake box 3D view, tamper sticker seam |
| SpecRail | Sidebar Rail | Material substrates, finishing coats, pantone chips | Side rail on all 72 individual artifact routes |
| Cut, Fold, Glue, Dim | SVG Primitives | Cyan cut lines, magenta crease folds, cross-hatch tabs | CAD packaging dieline precision vectors |
5. Measured Engineering Metrics
Audited performance figures and test coverage copied directly from the canonical LOG.md:
Artifacts Built
Wings Shipped
Unit Tests (25 files)
E2E Playwright Tests
Axe Violations
First Load JS (Lobby)
6. Market Context & Architectural Independence
Contemporary food and beverage technology is heavily distorted by commercial aggregators. Delivery marketplaces like Zomato, Swiggy, and Blinkit charge 28% to 35% commission on gross order value while obscuring direct customer relationships. Conversely, legacy chain bakery operations like Theobroma and Monginis rely on industrial central commissaries with frozen dough distribution and rigid POS software.
Crumbloom represents an alternative architectural paradigm: an independent, local artisan bakehouse executing 36-hour slow cold fermentation with direct customer digital touchpoints. By integrating custom cake ordering, instant WhatsApp booking confirmations, live kitchen dispatch boards, and packaging dielines under a single shared token kernel, the business eliminates third-party aggregator tax while preserving complete control over food safety, statutory compliance, and unit profitability.