Chimera Cards is a web-based tactical turn-based combat game where each player builds two hybrids (each composed of 2–3 entities) and battles in simultaneous-planning rounds. The backend is written in Go (Gin + GORM) and the frontend is a React + TypeScript single-page app.
This README contains common, cross-cutting information and links to the module-level documentation for backend, frontend and infrastructure.
- Backend details:
backend/README.md - Frontend details:
frontend/README.md - Infrastructure (bootstrap + Terraform):
infrastructure/README.md - Game mechanics:
game.md
- Install prerequisites: Go, Node.js + npm, and
make. - Install frontend deps:
make frontend-install(seefrontend/README.md). - Configure backend env vars (see
backend/README.md). - Run both services:
make runBuild and run with Docker Compose (example):
docker compose build
docker compose up -dSee the module READMEs for detailed, focused documentation:
backend/README.md— backend setup, env vars, tests and build instructions.frontend/README.md— frontend dev server, build and test commands.infrastructure/README.md— bootstrap helper and Terraform workflow.game.md— full game mechanics documentation.
This project embeds build and VCS metadata into both backend and frontend artifacts and publishes Docker images to Docker Hub. The strategy provides:
- A canonical, human-friendly semantic/tag version (from
git describe --tags). - VCS commit short hash and build timestamp for traceability.
- A
dirtyflag when working tree had uncommitted changes at build time. - Version metadata exposed on the backend via
/api/version; the frontend reads this endpoint at runtime to surface the current build/version.
CI (GitHub Actions) builds images and pushes them to Docker Hub with both
the tagged version and latest tags. See .github/workflows/docker-publish.yml.
Required GitHub repository secrets (set in Settings → Secrets):
DOCKERHUB_USERNAME— Docker Hub username (used to authenticate push).DOCKERHUB_TOKEN— Docker Hub access token or password.REACT_APP_GOOGLE_CLIENT_ID— Google OAuth client id for frontend build (optional).REACT_APP_API_BASE_URL— API base URL for frontend runtime (optional).
How it works (summary):
-
CI computes
VERSION,COMMIT,BUILD_DATE,DIRTYfrom the repo state. -
The backend binary is built with
-ldflagsto inject these values and the final Docker image is labeled with the same metadata. -
The frontend reads
/api/versionat runtime so the SPA can surface the current build/version provided by the backend. -
The workflow pushes backend and frontend images to Docker Hub using the following canonical names:
ericogr/chimera-cards-backend:<version>andericogr/chimera-cards-backend:latestericogr/chimera-cards-frontend:<version>andericogr/chimera-cards-frontend:latest
Local build notes:
- Backend:
make -C backend buildwill embed version metadata detected from the local git repository. You can override values by passingVERSION=...COMMIT=...BUILD_DATE=...DIRTY=...tomake. - Frontend:
make -C frontend buildwill generatepublic/version.jsonand then run the production build.