← All projects

Score

A scorekeeper for cribbage and dominoes

Why I built it

My girlfriend and I are avid cribbage and dominoes players, and I got tired of carrying a cribbage board with me to breweries. So I built this for our own use: it keeps score on a phone and keeps a history of every game we've played.

What it does

Start a game with two players, then tap +/- buttons to score: 1 through 5, 10 and 15 for cribbage, 5 to 30 for dominoes. Cribbage always plays to 121; dominoes asks for a target between 100 and 250. A tap that would end the game asks for confirmation first, so a slip of the finger can't hand someone the win.

The home page shows games still in progress, the ten most recent finished games, and each player's wins and losses per game. Unfinished games can be picked back up or deleted.

How it's built

Code
Go server rendering HTML templates, with htmx swapping in each screen and Bootstrap for styling. Templates and the favicon are embedded in the binary.
Data
Firestore, with each score update in a transaction that also moves a finished game to the finished list. Player records are tallied from finished games rather than stored. A local mode swaps in JSON files so it runs without any cloud access.
Hosting
Google Cloud Run in a distroless container, capped at two instances, at score.mattlove.dev.
Deploying
GitHub Actions builds the image on every push to main, pushes it to Artifact Registry and deploys it to Cloud Run, authenticating through Workload Identity Federation so no keys are stored. Docs-only changes skip the deploy.