jonnify·bcs /bcs/codemojex/the-live-surface

B7 · module 6 of 6 · The Live Surface on Phoenix

The live surface on Phoenix.

A thin JSON facade of commands and privacy-safe views, a WebSocket channel on PubSub that pushes a result the moment the worker writes it and stays silent in a blind room, and the whole game as one supervised application shipped on Fly.

Three dives: the JSON API, channels and PubSub, and production on Fly — the layer that closes the chapter, where the model and the play meet the player.

A JSON facade, a channel on PubSub, and one supervised app on Fly. Select a part.
the JSON APIcommands return 202privacy-safe views channels on PubSublive pushblind stays silent one app on Flysupervisedno ephemeral tier
readout · Select a part. A JSON API of commands and privacy-safe views; a WebSocket channel fed by PubSub that pushes live and stays silent when blind; the whole game as one supervised app on Fly with no ephemeral tier.
§1

The three dives

each a leaf, the teaching
§2

The module, in one law

codemojex · the thin layer over the systems

B7.6 is the live surface: the thin Phoenix layer that lets players reach the game without ever owning its state. A JSON API turns a request into a command and a read into a privacy-safe view — a guess returns an accepted status while scoring runs behind the boundary, and a player can read only their own attempts, their best total, and the leaderboard, never a guess or the secret. Live updates ride a WebSocket channel fed by PubSub: the score worker publishes a scored event, and every channel on that game forwards it, so a result and the board move arrive at once — in a live room. A blind room publishes nothing per guess and stays silent until the close. The whole game runs as one long-lived application on Fly Machines, a single supervised tree over the database, PubSub, the bus and its workers, and the endpoint, with no ephemeral job tier because the load is steady and settlement is one batch pass. Three dives: the JSON API, channels and PubSub, and production on Fly.

§4

The doors

the sibling courses
§4

References

sources · related

Sources

Related