Skip to content

Sleep Map · Product engineering

Making permanent progress a data rule.

A gentle habit promise backed by persistent state: missed nights can reset a streak, but they never erase the territory someone has already earned.

← All engineering work
Role & scope
Independent · iOS
Built with
Swift · SwiftUI · SwiftData · Geographic data
Sleep Map showing territory collected over successive nights
Claimed territory remains part of the map even when a later night is missed.

The promise

Sleep Map connects a kept sleep routine with discovering a real place. The product is meant to reward returning without making a missed night undo earlier effort.

That promise needs to survive more than the success animation. It has to hold when the next night fails and when the app reloads its saved state.

Separate lasting progress

Claimed territory is stored as append-only progress. A streak can reset without removing previously claimed cells. Keeping those concepts separate in the data model makes the gentle behavior a rule the app can preserve.

The claim engine has tests around the frontier and already-claimed territory. These are checks of the underlying behavior, not evidence that the app improves sleep or habit retention.

A map people can read

The release map replaced an earlier globe because tonight’s place needed to be legible. The app uses prepared geographic cells and adjacency data to support territory that grows outward from home.

Prepared geography shifts work out of the interface and into content preparation and validation. That is a useful tradeoff for this product, but it also means geographic coverage is a release constraint: the initial release covers the United States.

What I take from this

A product promise is easier to preserve when it is reflected in the data model. Here, separating permanent territory from a temporary streak makes the intended behavior clear to both the interface and the tests.