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:
+1
-3
@@ -7,9 +7,7 @@
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "oxlint",
|
||||
"preview": "vite preview",
|
||||
"scores": "node --watch server/src/index.ts",
|
||||
"dev:all": "node scripts/dev-all.mjs"
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^19.2.8",
|
||||
|
||||
Reference in New Issue
Block a user