Full-service restaurant kitchen porter - tableware stock and dishpit pacing calculator - have a coding agent build a single-file page where you enter covers, place settings, plate-change counts, and wash capacity, and it computes how much clean stock the pre-service wash must deliver
You are a coding agent. Build me a single-file HTML "tableware stock and dishpit pacing" calculator for the dish pit of a full-service restaurant: enter the room, settings, wash capacity, and peak windows, and it computes the pre-service wash target per category and lays out in-service hourly capacity. No network, no dependencies, no external resources; opens in any phone or desktop browser.
1. Inputs ("Setup" page, three groups)
- Room: dining tables and total covers, private rooms and covers, banquet reserve tables (with a "banquet today" toggle - banquet mode multiplies straight by table count)
- Settings: per-category per-cover config - change plates (pieces per cover), soup bowls, teacups, glassware (type selected by drinks tier); each category carries the house "plate / glass change count" (two presets for hosted vs family service, switched manually)
- Wash capacity: machine in [racks per hour] (with standard pieces per rack per category) or manual in [settings per hour]; closing window; peak windows (lunch and dinner start and end)
2. Calculation rules (hard rules, all shown on the page)
1. Category demand = full covers x pieces per cover x (1 + change count) x turn factor (2 if the peak expects one turn, 1 if not - manual choice); banquet mode replaces this with banquet tables x per-table setting, straight multiplication
2. Stock gap = demand - current clean stock (editable from the home screen); when short, compute the pre-service wash line: the amount that must be washed before peak starts, converted to "racks still needed / racks per hour = hours of lead time"
3. Capacity schedule: hourly "returns in vs capacity out" through the service - in-service returns arrive spread evenly across the peak as an estimate; hours that do not clear get flagged red with "this category expected to be run over at [time]"; the tool may never reduce the plate-change count to "solve" a gap - gaps are displayed and flagged, never quietly edited away
4. Breakage margin: recommended stock adds [10]% over demand (adjustable), with the gap between current inventory and recommended stock shown
3. Views
- Home table: one row per category - demand / clean stock / pre-service line / gap / recommended stock; gap rows in red
- Hourly strip: a timeline from lunch to close, one cell per hour of "returns vs capacity"; cells that do not clear are red with the shortfall count
- Banquet toggle: one switch flips banquet mode and recalculates everything
4. Data and safeguards
- Everything in localStorage, with JSON export / import
- Change counts, capacity, and turn factor are all mandatory - no generation while any is blank; better no number than a silent default
- No prefilled "industry plate-change" or "standard capacity" templates - service styles and equipment differ per house, and a prefilled number becomes the basis of a wrong decision; the tool only solves constraints, the judgment stays with the pit
- Numeric inputs validated (covers and pieces non-negative, capacity positive)
UI: home screen (results) in large type and one big table; setup page desktop-first. Deliver one complete HTML file with all CSS and JS inline, plus a Chinese usage note under two hundred words.
Why it is written this way
Tableware runs out at the second wave of plate changes, not at open - that fact is the design's starting point. At open, every table is set and nothing feels scarce; the dish pit's capacity meets its first real pressure only when plates hit their third round and soup bowls circulate between courses. So the tool's key output is not "how much total" but the pre-service wash line: the rush-hour gap translated into "wash N racks by H hours before peak", giving the porter a concrete morning task instead of a chased afternoon.
Change counts and turn factors are mandatory self-entry with no prefilled templates because these numbers differ by a factor of two between houses: hosting restaurants change plates three rounds, family houses one. Prefill a "typical value" and the calculator becomes a source of confident wrong decisions. The tool only does what it is good at - constraint solving - and the judgment stays with the person: the same discipline as the maintenance-calendar tool refusing to prefill equipment templates.
When the hourly schedule does not clear, the tool may only flag red - never lower the plate-change count on its own - to prevent a beautiful fake completeness: silently changing three rounds to two makes the page turn green while the service standard was downgraded by software. That kind of "smart" is the fastest way a tool loses its users. Gaps must exist in red; whether the standard bends is a human call.
Every formula stays visible on the page for the person who arrives half a year later: when a new porter takes over, the on-screen math is the handover document - where each number came from and who set which parameter - with no code-diving and no calling the predecessor. Banquet mode is a toggle rather than a separate page because a banquet day differs from a regular day only in inputs, not logic, and every extra page is one more place to forget to update.
Variables
| Variable | Notes |
|---|---|
| Plate-change counts | How many changes per category in this house - hosted vs family presets; the single highest-impact input in the model |
| Wash capacity | Machine racks/hour (with pieces per rack) or manual settings/hour - measured throughput, not nameplate rating |
| Turn factor | Whether the peak expects a turn - manual choice, never auto-predicted |
| Breakage margin | Uplift on recommended stock - 10% default, tuned to your breakage rate |