05 / 05 WORK / PROJECT← All work

Simulation · Product Engineering · Frontend Architecture

Smart City Energy Simulation

A browser-based simulation game about municipal energy supply. I was especially interested in keeping its rules testable and understandable.

Context

Players build solar and wind generation, storage and subsidy programs while dealing with budget, demand, weather and citizen satisfaction.

Approach

I kept most simulation logic separate from React, the DOM and localStorage so rules could be tested and understood independently from the interface.

System

  • React + TypeScript: interface
  • Leaflet: map interaction
  • Separated domain and simulation logic
  • Python: independent comparison model
  • Playwright: browser tests
SYSTEM LAYERS
BackendInterfaceOperations

Engineering decisions

  • Keep domain rules out of UI components.
  • Use unit, integration and browser tests.
  • Document game rules and model boundaries.

What did not work

The application is intentionally not a real power-grid simulation. A model should not pretend to be more accurate than its assumptions.

Result

The project includes tests, an independent Python comparison model, CI on Linux and Windows, and Docker deployment.

What stayed with me

Separation does more than make testing easier. It also forces the model rules to be explained independently from their presentation.