Move the board out to the service every game shares
The leaderboard started in this repository because when it was written there was one game. It was already being treated as shared -- games.jcoffey.dev calls it "the shared leaderboard" in its compose file and nginx proxies it at a site-wide /api/ rather than under /lemonade/ -- but it was still this game's code, and the second game would have meant a second container, a second volume and a second database to back up for every game after that. It lives in https://github.com/Coffey-Labs/games-scores now, which is its own repository rather than either game's. A shared board belongs to no game, and leaving it here would have made every future game depend on the lemonade stand for its leaderboard. What changes here is smaller than the diff suggests. server/ goes, and with it scripts/dev-all.mjs and two package scripts. The client names the game on every call and is otherwise untouched: rows still come back as assets, days, glasses and broke, because the shared service hands each game its own field names back. Nothing about the deployed board moves. The volume keeps its name, the rows are migrated in place on first boot, and the original table is kept alongside as scores_lemonade_v1 rather than dropped -- it is the only copy of a board real people are on. Bundles already in browsers keep working too: a post with no game at all is treated as this one, deliberately, until this build has been out long enough that nobody is running the old one. Build clean.
This commit is contained in:
@@ -61,12 +61,21 @@ finished are picked out in yellow.
|
||||
There is no way to clear it. A stand leaves the list only by being pushed off
|
||||
the bottom by a better one, so a good summer stands until somebody beats it.
|
||||
|
||||
The board lives in `server/`, not in the browser, so it is the one part of the
|
||||
game that needs a line out. With the service unreachable the game plays exactly
|
||||
as normal and the board says so plainly rather than breaking; posting happens
|
||||
behind the closing standings, so a slow network never holds up the end of a
|
||||
season. See [server/README.md](server/README.md) for the API, the validation
|
||||
and what a board with no accounts can and cannot promise.
|
||||
The board is no longer in this repository and is no longer ours alone: every
|
||||
game on the site shares one service,
|
||||
[games-scores](https://github.com/Coffey-Labs/games-scores), which is one
|
||||
container and one volume however many games there are. It started here, because
|
||||
when it was written there was one game; a second game would have meant a second
|
||||
container and a second database to back up for every game after that. All this
|
||||
repository holds now is the client in `src/game/highscores.ts`, which names the
|
||||
game on every call and is otherwise what it always was — rows come back in this
|
||||
game's own field names.
|
||||
|
||||
It is still the one part of the game that needs a line out. With the service
|
||||
unreachable the game plays exactly as normal and the board says so plainly
|
||||
rather than breaking; posting happens behind the closing standings, so a slow
|
||||
network never holds up the end of a season. That repository's README has the
|
||||
API, the validation and what a board with no accounts can and cannot promise.
|
||||
|
||||
## How it is put together
|
||||
|
||||
|
||||
Reference in New Issue
Block a user