~/
rust-munich
·
crux + gpui
# Our guinea pig A **counter app with a weather twist**. ``` ┌─────────────────────┐ │ 42 │ ← big count │ [ − ] [ + ] │ │ ─────────────────── │ │ ☀ 18.3 °C │ ← weather card │ 6 May 2026 · 11:30│ └─────────────────────┘ ``` --- ## Rules - `+` increases the counter by 1. `−` decreases by 1. - Every time the counter **crosses a multiple of 10** (including 0, ±10, ±20…), we fetch the current weather in Munich. - The weather card updates on success. On error, we keep the old card. - Rapid clicks across a multiple do **not** fire two requests at once (a small in-flight guard). --- ## Why this exact app? Small enough to fit on one slide. Big enough to exercise the four things we need to see: - The counter `+` / `−` is pure state mutation. - The multiple-of-10 rule fires a side effect from pure logic. - The HTTP response comes back into the core as a new `Event`. - The UI is real — buttons, text, a colored chip, a timestamp. It's the smallest app that makes both sides talk to each other. --- ## What lives where | Concern | Lives in | Crate | |---------------------------|--------------------|----------| | State, rules, the counter | The core | `core` | | Button rendering, layout | The shell | `shell-gpui` | | Actual HTTP call | The shell | `shell-gpui` | | Theme, the `Tag` widget | `gpui-component` | (dep) | The core does **not** know that gpui exists. It does **not** know how the weather is fetched. It only knows that *someone* will fulfil its `FetchMunichWeather` request and send a `WeatherLoaded` event back. That separation is the whole point.