Dough Lab

About the Project

Dough Lab is a small, logic-driven React application built to explore how clear domain modeling and type safety can simplify real-world calculations. Instead of focusing on visual polish, the project emphasizes predictable data flow, explicit math, and reusable abstractions. It turns geometric inputs and style rules into precise ingredient breakdowns while keeping the codebase readable and easy to reason about.

How It Was Built

The app is structured around a simple calculation pipeline that separates concerns cleanly. Pan geometry is modeled with discriminated unions to ensure only valid dimensions are accepted. Style rules are mapped to density values, which feed into a single calculation function that derives total dough weight and ingredient ratios using baker’s percentages. Global state is managed with a lightweight store, and shared UI controls are implemented as generic, strongly typed components to avoid duplication.

Key Features

  • Geometry-aware dough calculations using discriminated unions
  • Style-based dough density modeling
  • Baker’s percentage ingredient breakdown
  • Metric and imperial output rendered side by side
  • Global state with minimal, focused subscriptions
  • Reusable, type-safe form controls
  • Explicit, readable calculation pipeline over “magic” abstractions
ReactTypeScriptZustandVite