DEV Community

Cover image for a city that remembers what you did
Sanskar Kharya
Sanskar Kharya

Posted on

a city that remembers what you did

Sanity Challenge Path Two Submission

This is a submission for the Sanity Challenge, Path Two: Vibe-Code Something Strange.

What I Built

i built the department of tiny consequences, a small fictional city that changes as you play. a bench disappears from a tram stop. you can draw it back in chalk, ask where it went, or talk to someone who relied on it after a night shift. each decision takes you to another scene and adds a visible path to the city map. a same-place change loops around its pin. the route moves from daylight into night and reaches a morning ending instead of running forever.

try the short route: draw the bench, send the sketch to the office, open the old ledger, make a public map, follow the last tram, then read the morning notice. after every choice, the map opens to show what changed. use the red button to read the next scene.

there is also a visitor scene desk. anyone can write a small event for one of the city's six places. it enters Sanity as a private draft, not as public content. an editor can review and publish it; only published visitor scenes appear on the public city wall. no visitor scene has been approved yet, so the wall says that plainly.

Demo

play the city

no login required to explore. on mobile, the map and story stack into a single column. i tested a full mobile route through the ending as well as a desktop route through the previously looping ledger and last-tram scenes.

Code

Full source: https://github.com/MaybeSomeone-arc18/tiny-consequences-sanity - README covers the demo route, schema and moderation notes.

My Build Process

i used AI assistance to build and iterate the app, then tested its claims against the actual running site. the first version was too much like a landing page. i changed it into a branching story with a city map, a consequence ledger and a draft form. then the live playtest found a bigger problem: you could keep choosing scenes on the Story tab without ever seeing the map change. the graph also had a loop through the ledger, last tram and office. that was the opposite of the experience i was trying to make.

so i changed the interaction rather than adding a tooltip. each choice now opens the map and traces the new route segment in red. if the choice changes something at the same stop, it makes a small loop around that pin. a clear button leads into the next scene. i rebuilt the story edges as a forward-only graph: 17 published scenes, 33 choices, six places, 50 possible routes, one conclusion. an audit checks that every node is reachable, that time advances on every edge, and that no path cycles or dead-ends before the conclusion. i then played a full desktop route and a different full mobile route to the ending.

Sanity is the story's source, not a decorative CMS. tinyPlace records the six mapped places and coordinates. Each tinyConsequence has a scene, linked place, elapsed time, visible ripple, editorial state and an array of choices that reference the next consequence. tinyScenario points to the start. tinyVisitorScene holds visitor drafts separately, with an editorial state and editor note. The Next.js page queries the published records at request time and ignores references to unpublished scenes. The public visitor wall queries only published visitor scenes. The draft endpoint validates input, checks the place exists, rate-limits submissions and writes to a private Sanity draft document. The write token stays server-side.

The map is a projection of those records: muted lines show possible cross-place links, and the visitor's current route is drawn over them. The route lives in the current browser session. It is not saved across visits; only a published visitor scene persists in Sanity. I used an ordinary Sanity Studio schema and a human review step, not the App SDK or Sanity Workflows, so i am not claiming those features.

The biggest lesson was that a feature does not exist for a judge if they never see it in the first two minutes. Moving the map into the choice flow mattered more than adding another animation.

Sanity Project Details

project id: 7i4i5k0j, dataset: production. the story documents use the tiny. prefix; they share a Sanity project with a separate tax-copilot experiment but use different document types and app routes. the public app reads published story content; visitor drafts are not shown until an editor publishes them.

Top comments (0)