{"id":46905605,"url":"https://github.com/connected-web/boardgames-api","last_synced_at":"2026-03-11T01:10:06.387Z","repository":{"id":37245709,"uuid":"146212855","full_name":"connected-web/boardgames-api","owner":"connected-web","description":"An API for serving up boardgame data to other services.","archived":false,"fork":false,"pushed_at":"2026-01-01T22:30:55.000Z","size":10590,"stargazers_count":17,"open_issues_count":6,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-07T05:35:33.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/connected-web.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-26T20:10:06.000Z","updated_at":"2026-01-01T22:30:59.000Z","dependencies_parsed_at":"2024-05-13T21:37:19.755Z","dependency_job_id":null,"html_url":"https://github.com/connected-web/boardgames-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/connected-web/boardgames-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fboardgames-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fboardgames-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fboardgames-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fboardgames-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connected-web","download_url":"https://codeload.github.com/connected-web/boardgames-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fboardgames-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30365047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-11T01:10:05.901Z","updated_at":"2026-03-11T01:10:06.376Z","avatar_url":"https://github.com/connected-web.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boardgames API\n\nAn API for personalized boardgame data, sourced from boardgamesgeek.com and other locations. This project helps gather board game ownership and play stats; collate and analyse that data, and present that data as its own API with documentation.\n\n## Prerequisites\n\nYou should already have installed:\n- node LTS and npm\n- php \u003e= 7\n\n## Setup\n\nClone this repo, change to source directory, then run:\n```\nnpm install\nnpm start\n```\n\nThis should start a local webserver:\n```\n[PHP Test Server] listening at http://localhost:4000/\n```\n\n## Tests\n\nIf the webserver is running ok, then you should be able to run:\n\n```\nnpm test\n```\n\nThese tests are run when attempting to commit or push back to the central repo.\n\n## Usage\n\nFor a list of commands, use `node run`; this outputs:\n```\n[Board Game API Run] Available scripts to run:\n  node run all\n  node run convert-playstats-to-playrecords\n  node run create-all\n  node run create-bgg-index\n  node run create-boardgame-feed\n  node run create-boardgame-index\n  node run create-boardgame-list\n  node run create-boardgame-summaries\n  node run create-unique-list-of-played-games\n  node run download-all\n  node run download-bgg-collection\n  node run download-bgg-entries\n  node run download-cali-playstats\n  node run update-all\n```\n\n### Run All\n\n`node run all`\n\nRuns download-all, then create-all, in sequence.\n\n### Create All\n\n`node run create-All`\n\nRuns all of the `create-*` commands, in sequence. Logically should be run after downloading updated data from remote servers.\n\n### Create Board Game Geek Index\n\n`node run create-bgg-index`\n\nCreates `data/bgg-index.json` based on data from our Board Game Geek collection; `data/bgg-collection.json`\n\n### Create Board Game Feed\n\n`node run create-boardgame-feed`\n\nCreates `data/boardgame-feed.json` as a date sequenced game feed based on the Cali Play Stats.\n\n### Create Board Game Index\n\n`node run create-boardgame-index`\n\nCreates `data/boardgame-index.json` based on a unified view of Cali Play Stats and the Board Game Geek collection as well as individual game entries in `data/index/{board-game-api-id}.json`.\n\n### Create Board Game List\n\n`node run create-boardgame-list`\n\nCreates `data/boardgame-names.json` based on a unified view of Cali Play Stats and the Board Game Geek collection.\n\n### Create Board Game Summaries\n\n`node run create-boardgame-summaries`\n\nCreates `data/boardgame-summaries.json` and entries for `data/boardgame-summary-{yyyy}-{dd}.json` containing play stats summarised for a given months of the year.\n\n### Create Unique List of Played Games\n\n`node run create-unique-list-of-played-games`\n\nCreates `data/unique-list-of-games-played.json` containing a unique, sorted list of games that have been played based on the Board Game Feed.\n\n### Download All\n\n`node run download-all`\n\nRuns all of the `download-*` commands in sequence. This will take several minutes to complete as it includes running `download-bgg-entries`; but it should ensure all the available data is up to date.\n\n### Download Board Game Geek Collection\n\n`node run download-bgg-collection`\n\nDownloads `data/bgg-collection.json` from our Board Game Geek collection, as XML and converts it to JSON.\n\n### Download Board Game Geek Entries\n\n`node run download-bgg-entries`\n\nDownloads individual board game entries to `boardgames/boardgame-${bggGameId}.json` from Board Game Geek based on our Board Game Geek collection `data/bgg-collection.json`. This can be quite slow, but will retry until it got healthy responses for all boardgame IDs.\n\n### Download Cali Play Stats\n\n`node run download-cali-playstats`\n\nDownloads `data/cali-playstats.json` from Google Sheets and converts to JSON.\n\n### Updated Owned Lists\n\n`node run update-all`\n\nTo help update and analyse owned games, this command runs:\n- Download Cali Play Stats\n- Download Board Game Geek Collection\n- Create Unique List of Played Games\n- Create Board Game List\n\n## APIs\nData is sourced from the following APIs:\n\n| Name                   | Template                                                                |\n| ---------------------- | ----------------------------------------------------------------------- |\n| Board Games Collection | `https://www.boardgamegeek.com/xmlapi2/collection?username=${username}` |\n| Board Game Entries     | `https://www.boardgamegeek.com/xmlapi2/thing?id=${objectId}\u0026stats=1`    |\n| Board Game Play Stats  | `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}`        |\n\n## Workflows\n\nThere are three workflows in the .github/workflows/ folder which provide continous integration support for this codebase.\n\n### PR Check\n\n- `.github/workflows/pr-check.yml`\n\nThe PR Check workflow runs when raising a PR - it will check for linting, run the unit tests, generate local data, and run the integration tests.\n\n### Deploy\n\n- `.github/workflows/deploy.yml`\n\nThe Deploy workflow runs when merging to master - it will run the unit tests, integration tests, and then upload any code and static assets required for the PHP API.\n\n### Update Play Stats\n\n- `.github/workflows/update-play-stats.yml`\n\nThe Update Play Stats workflow runs on a schedule, but can also be triggered manually - it will run `update-all`, followed by `create-all` before uploading JSON data to the server to be made available through the PHP API.\n\n### Rehydrate Playrecords\n\n- `.github/workflows/rehydrate-playrecords.yml`\n\nThis workflow is manual-only and calls the `POST /playrecords/rehydrate` endpoint to scan S3 keys and (optionally) move misfiled playrecords. It can also rebuild grouped cache files for a given year or for the months it touches. Use this sparingly because it scans S3 prefixes and can be expensive.\n\nInputs:\n- `account`: target environment (`dev` or `prod`).\n- `mode`: `all`, `year`, `month`, or `custom` prefix scan.\n- `year`/`month`/`prefix`: scope the scan.\n- `dryRun`: if true, only reports what would change.\n- `maxKeys`: optional scan limit.\n- `rebuildTouched`: rebuild grouped caches for months that were touched.\n- `rebuildYear`: rebuild grouped caches for all months in a year (e.g. `2025`).\n\nRecommended usage:\n- Start with `dryRun=true` to confirm what will move.\n- Then rerun with `dryRun=false` and either `rebuildTouched=true` or `rebuildYear=YYYY`.\n\n## S3 Data Layout\n\nPlayrecords are stored in an S3 bucket (e.g. `boardgames-api-playrecords-prod`) with a month-based prefix:\n\n```\nplayrecords/YYYY/MM/\u003cISO_TIMESTAMP\u003e.json\n```\n\nEach object is a single play record JSON document and includes a `date` field in `DD/MM/YYYY` format. The filename uses the creation timestamp, not the play date.\n\nGrouped cache files are stored separately to speed list requests:\n\n```\ngrouped/byMonth/YYYY-MM_playrecords.json\ngrouped/byYear/YYYY_playrecords.json\ngrouped/byAllTime/all_playrecords.json\n```\n\nThese grouped files are rebuilt by list endpoints or the rehydrate workflow. If the grouped file exists with `[]` (2 bytes), the system will return empty results until the cache is rebuilt.\n\n## Playrecord Endpoints\n\n### Create Play Record\n\n`POST /playrecords/create`\n\nStores a play record under `playrecords/YYYY/MM/\u003ctimestamp\u003e.json` where `YYYY/MM` is derived from the payload `date` (`DD/MM/YYYY` or `YYYY-MM-DD`).\n\n### List Play Records (All)\n\n`GET /playrecords/list`\n\nReturns all play records by reading grouped cache files. It only force-refreshes the current and previous month for the current year; older months return cached results.\n\n### List Play Records By Date\n\n`GET /playrecords/list/{dateCode}`\n\n`dateCode` must be `YYYY` or `YYYY-MM`. This endpoint currently forces a refresh of the cache for the requested date code by listing `playrecords/YYYY/MM/` and rewriting the grouped cache for that month or year.\n\n### Local Testing of Github Workflows\n\nWorkflows for pull requests, and build and deploy can be found in `.github/workflows/`.\n\nTo test the workflows locally you can install [nektos/act](https://github.com/nektos/act).\n\n`act` requires Docker installed for your operating system.\n\nOnce `act` is setup you can then run:\n- `act push` : simulate push to master event ; triggers build and deploy\n- `act pull_request -P ubuntu-latest=nektos/act-environments-ubuntu:18.04` (Warning: the full ubuntu image requires a cacheable 18GB download at first run)\n\n### Quick Update Commands\n\nTo do a quick update of board game stats and upload to the API:\n```\nnode run update-all \u0026\u0026 node run create-all \u0026\u0026 node deploy live-summaries\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnected-web%2Fboardgames-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnected-web%2Fboardgames-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnected-web%2Fboardgames-api/lists"}