{"id":51060044,"url":"https://github.com/rabestro/dicechess-analytics","last_synced_at":"2026-06-23T01:01:15.610Z","repository":{"id":363184555,"uuid":"1261207956","full_name":"rabestro/dicechess-analytics","owner":"rabestro","description":"High-performance analytical backend and data pipeline for Dice Chess. Ingests, normalizes, and analyzes 140k+ games using Scala 3, PostgreSQL, and the dicechess engine.","archived":false,"fork":false,"pushed_at":"2026-06-15T16:48:46.000Z","size":451,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T17:06:19.495Z","etag":null,"topics":["chess-analytics","data-pipeline","data-warehouse","dice-chess","etl","fastapi","postgresql","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://jc.id.lv/dicechess-analytics/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rabestro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-06T11:34:59.000Z","updated_at":"2026-06-15T16:48:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rabestro/dicechess-analytics","commit_stats":null,"previous_names":["rabestro/dicechess-analytics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rabestro/dicechess-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rabestro","download_url":"https://codeload.github.com/rabestro/dicechess-analytics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-analytics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34671045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["chess-analytics","data-pipeline","data-warehouse","dice-chess","etl","fastapi","postgresql","sqlalchemy"],"created_at":"2026-06-23T01:01:14.292Z","updated_at":"2026-06-23T01:01:15.597Z","avatar_url":"https://github.com/rabestro.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dice Chess Analytics\n\nHigh-performance analytical backend for Dice Chess. Stores, normalizes, and analyzes\n140k+ games using Scala 3, PostgreSQL, and the\n[dicechess engine](https://github.com/rabestro/dicechess-engine-scala) as the single\nsource of truth for game rules.\n\n## Overview\n\nThe `dicechess-analytics` project is the data engine of the Dice Chess ecosystem: it\nstores game history, turns, and deduplicated board positions, and serves them through a\ntyped REST API consumed by\n[dicechess-analytics-ui](https://github.com/rabestro/dicechess-analytics-ui). The\nlong-term goal is position analytics — empirical win statistics and expected value per\nposition, the metric that matters most in a dice-driven chess variant.\n\n## Tech Stack\n\n- **Backend**: Scala 3 — http4s (Ember) + Tapir (typed endpoints, Swagger UI at `/docs`)\n- **Database**: PostgreSQL 18; access via Doobie, migrations via Flyway\n- **Game rules**: `lv.id.jc:dicechess-engine-scala` (GitHub Packages Maven)\n- **Tests**: MUnit + testcontainers (real PostgreSQL)\n- **Tooling**: [mise](https://mise.jdx.dev/) (toolchain + tasks), lefthook (git hooks),\n  Docker Compose\n\nSee the [development guide](docs/src/content/docs/development.md) for setup details\n(requirements, configuration, Rancher Desktop / testcontainers notes).\n\n## Developer Workflows\n\nThis project uses `mise` as the core task runner. Use `mise run \u003ctask\u003e` from the root of\nthe repository.\n\n### Core Commands\n\n- `mise run setup` - Installs tooling and registers lefthook git hooks.\n- `mise run compile` / `test` / `run` - Scala build tasks (run directly from the root).\n- `mise run check` - Repo-wide gate: full validation (format check, coverage-gated tests).\n- `mise run format` - Reformats the Scala sources.\n\n### Database \u0026 Services\n\n- `mise run db:up` - Starts only the PostgreSQL container in the background.\n- `mise run db:down` - Stops and removes only the PostgreSQL container (the data volume survives).\n- `mise run stack:up` / `mise run stack:down` - Full stack (db + api + ui) from published images.\n\nDatabase schema migrations are applied by the backend itself via Flyway on startup.\n\n### Documentation\n\n- `mise run docs:dev` - Runs the local Astro/Starlight docs dev server.\n- `mise run docs:build` - Builds the static documentation site.\n\n## Deployment\n\nEvery push to `main` touching the Scala sources publishes the multi-arch image\n`ghcr.io/rabestro/dicechess-analytics-api`. The production server needs only two files:\n`docker-compose.yaml` and `.env` (the compose project name is pinned, so the deploy\ndirectory can live anywhere without losing the data volume).\n\nProduction pins the image to a released version with `API_TAG` in its `.env`\n(e.g. `API_TAG=v0.1.5`), so `docker compose pull` fetches that exact tag instead of a\nfloating `:latest` — a non-booting build can no longer reach prod on a re-pull (issue\n[#117](https://github.com/rabestro/dicechess-analytics/issues/117)). Promote by bumping\nthe pin to a staging-verified tag, then:\n\n```bash\ndocker compose pull api \u0026\u0026 docker compose up -d api\n```\n\n### Staging-first promotion\n\n`docker-compose.yaml` reads the image tag from `API_TAG` (default `latest`), so one\nfile serves every environment. CI smoke-tests each image before publishing it\n(`.mise/tasks/smoke-test`); before a tag reaches production it is also verified on the\nstaging stack (Dexus):\n\n```bash\nmise run staging:deploy v0.1.5   # deploy + smoke-check a candidate tag on staging\n```\n\nThe task syncs the compose to the staging host, rolls `api` to the candidate tag, then\nfails unless the deployed endpoint serves `GET /`, reports the expected version at\n`/version` (asserted for `vX.Y.Z` tags), and returns 401 for an unauthenticated\n`POST /api/games`. On green, promote deliberately: bump `API_TAG` in the prod `.env`\nto that tag and pull (see above).\n\n## Roadmap \u0026 Milestones\n\n1. **v0.1 - Foundation \u0026 Local Setup** — done: schema, initial data import (140k+ games).\n2. **v0.2 - Ingestion API \u0026 Scala rewrite** — done: read-parity Scala backend in production and transactional `POST /api/games` with engine-side validation.\n3. **v0.3 - Position Analytics \u0026 Deduplication** — active: position statistics API.\n4. **v0.4 - Aggregate Metrics \u0026 Materialized Views** — rating histories, opening stats.\n5. **v1.0 - Production Readiness \u0026 CI/CD** — observability, hardening.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fdicechess-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frabestro%2Fdicechess-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fdicechess-analytics/lists"}