Engineering inside Morrow /
The data model, constraints and recovery decisions behind Morrow.
A friendly green identity and a detailed miniature solar home introduce the energy story. The next section lets visitors change assumptions and follow the calculated flows.
Interface and interaction architecture
Svelte controls the interactive energy model, while D3 Sankey renders calculated flows. The public view and saved notebook use the same bounded energy calculation.
One calculation serves the interface and server
The pure calculation module is shared by the browser and server, avoiding separate formula implementations that can drift. The server validates finite numeric inputs and supported bounds, including initial energy no greater than capacity. The result exposes power and energy terms, conversion losses and an energy-balance residual for inspection.
Charging respects both power and available space
Direct solar supplies load first. When solar exceeds load, charging is limited by the remaining surplus, the battery power limit and the energy headroom divided by efficiency and interval duration. Stored energy increases by charging input multiplied by duration and efficiency. Any surplus beyond the permitted charge becomes grid export in this simplified model.
Discharging respects usable stored energy
When load exceeds solar, discharge is limited by the deficit, the power limit and initial stored energy multiplied by efficiency, divided by duration. Supplying one unit of useful discharge consumes more than one stored unit when efficiency is below one hundred percent. The model reports that difference as conversion loss and uses grid import to cover the remaining deficit.
Saved scenarios are distinct from submitted snapshots
Versioned scenario records use the common local persistence and idempotent write boundary. A consultation references saved scenarios but also stores their submitted snapshots. Later scenario edits therefore do not alter what the consultation contains. The PDF is produced from saved server data, making it possible to inspect the assumptions with the exported result.
Operating the product
Label every scenario with the interval and assumptions it represents. Keep measured data, estimates and illustrative values distinguishable in the name or accompanying discussion, so the saved comparison does not acquire a misleading claim of precision.
Check units before interpreting a result. Kilowatts describe power; kilowatt-hours describe energy over time. The evening fixture imports 4.1 kW for two hours, which corresponds to 8.2 kWh, rather than two alternative estimates of the same quantity.
Change a small number of assumptions at a time when comparing alternatives. A simultaneous change in solar, load, battery and interval can produce an interesting picture while making it difficult to explain which input caused the result.
Save the intended scenario before including it in a consultation. If you later revise an assumption, the earlier consultation retains its snapshot; prepare a new request when the reviewer needs the revised set rather than assuming the old request updates itself.
Retain the exported inputs with the output when sharing a scenario. Before a real equipment or installation decision, establish the additional measurements, time-series modelling and professional review required for that decision.
Independent by construction
Morrow has its own application source, build configuration, local server, database, object store and session cookie. The fifteen applications reuse copies of a common foundation, but their operational data and credentials are independent. A shared dependency cache on this Mac saves disk space; each product includes a lockfile and a command to install its own dependencies.
Mutations validate the workspace and current record version. Approval binds the reviewed content digest; an idempotency key prevents an identical retry from becoming a second action. These controls are implemented in the server, alongside the product-specific rules described above.
A similar problem in your business?
Bring a real workflow, representative inputs and the result that needs to be reliable.
Shape a project brief