- TypeScript 65.8%
- JavaScript 26.7%
- CSS 6.2%
- Python 1%
- HCL 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Suite tofu / scope (push) Successful in 51s
Suite cluster-service / scope (push) Successful in 51s
Suite cluster-service / check-manifests (push) Has been skipped
Suite cluster-service / check-image (push) Has been skipped
Suite cluster-service / publish (push) Has been skipped
Suite web-app / scope (push) Successful in 53s
Suite cluster-service / reused-checks (push) Has been skipped
Suite web-app / publish (push) Has been skipped
Suite web-app / reused-checks (push) Has been skipped
Suite web-app / check-test (frontend) (push) Has been skipped
Suite tofu / check-plan (push) Has been skipped
Suite tofu / apply (push) Has been skipped
Suite tofu / reused-checks (push) Has been skipped
Suite web-app / check-image (push) Has been skipped
Suite web-app / publish-static (push) Has been skipped
Suite web-app / check-test (backend) (push) Has been skipped
|
||
| .claude | ||
| .codex/environments | ||
| .forgejo/workflows | ||
| backend | ||
| bin | ||
| docs | ||
| frontend | ||
| k8s | ||
| packages/board-render | ||
| scripts | ||
| tofu | ||
| tools | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .nvmrc | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| Dockerfile | ||
| newrocks-code.txt | ||
| README.md | ||
Chess Tactics
Chess-based squad combat prototype.
The sample is a small tactical browser game served by Node/Express. Three hybrid chess units defend anchors against enemy telegraphs across six breaches.
Local Dev
Use Vite for local development. It dynamically acquires a frontend port and
spawns the backend on its own free port, then proxies /api through Vite.
Open the local URL printed by Vite.
cd frontend
npm install
npm run dev
Windows Codex desktop environments are named on the
auth.romaine.life approval page opened during worktree setup. The approved
name returns beside the development token, then setup starts Vite through
devctl and registers the dynamic port with the workstation's loopback Caddy
router, producing a stable URL such as:
http://loading-feature.chess-tactics.localhost
The ignored .codex-session/environment.json is the non-secret source of truth
for that environment identity. The auth grant, agent URL discovery, browser
verification, screenshots, and user handoff all use the same name without a
project lifecycle hook. See
ADR-0199.
The responsibilities are deliberately separate: Caddy only routes, devctl
persists and recovers the top-level Vite launch, and Vite alone owns backend
child recovery. See
ADR-0308.
For baked preview:
cd frontend
npm install
npm run build
cd backend
npm install
npm start
Open http://localhost:3000.
The browser app is built by Vite. Express serves frontend/dist as the baked
frontend; source files live under frontend/src. Runtime media resolves through
backend-owned semantic /assets/<slot> routes backed by Postgres and private
object storage. frontend/public is limited to non-media code and legal text.
Production Links
- Main menu design portfolio: https://chess-tactics.com/design/main-menu
Local Backend
Level Editor documents use a stable /editor/level?document=<opaque-id>&levelId=<id> URL. The opaque document id is global; the level id remains account-local.
For authenticated editors, changes autosave to a durable server-side working copy;
Save promotes that working copy to the canonical level, while Discard changes
replaces it with the canonical saved level. Copying the browser URL is side-effect
free: it does not save, publish, grant access, or create another document. Gameplay
and thumbnails read only canonical saved levels. Browser storage is a crash/offline
fallback, not the cloud persistence model.
Fresh worktrees do not have backend/node_modules; that is expected every time.
npm run dev installs/refreshes backend dependencies before Vite starts the
backend child process.
The server uses auth.romaine.life as an OIDC provider for Microsoft sign-in.
Authorization code + PKCE runs through the backend, which keeps access and
refresh tokens in host-only HttpOnly cookies. Optional env:
AUTH_BASE_URLdefaults tohttps://auth.romaine.life.OIDC_CLIENT_IDdefaults tochess-tactics.PUBLIC_ORIGINdefaults tohttps://chess-tactics.comand pins callback URLs.FRONTEND_DIRdefaults to the builtfrontend/distdirectory.STATIC_FRONTEND_DIRdefaults to/var/run/chess-tactics-static-override.HOT_BACKEND_DIRdefaults to/var/run/chess-tactics-hot.LIVE_MEDIA_CONTAINER_URLselects the private production object store.LIVE_MEDIA_STORAGE_DIRselects isolated local/test object storage; it is mutually exclusive with the container URL and requires a disposable database.SCHEMA_MIGRATIONScontrols DB schema readiness:check(default, read-only),auto(apply missing migrations), oroff(skip readiness checks).
The container starts backend/supervisor.js as PID 1. The supervisor prepares
the runtime server entrypoint, runs it with NODE_PATH pointed at the baked
dependencies, and reloads the child process when PID 1 receives SIGHUP.
Test-slot validation should deploy the CI-built image for the pushed ref with
Glimmung deploy_image_to_test_slot, so backend code, frontend assets, and
runtime wiring are exercised from the same image that PR CI proved.
Persistence
Durable game/design data and live asset metadata live in Azure Database for
PostgreSQL, reached passwordlessly through Entra workload identity. Runtime,
review, candidate, and source-media bytes are content-addressed in private Blob
Storage; the backend resolves their database-owned semantic slots. No runtime
media is shipped from frontend/public. The database and storage are
self-provisioned by this repo's tofu/. Local backend startup defaults to
read-only schema checks. Run cd backend && npm run schema:migrate when you
intentionally want to apply missing migrations; the dedicated command verifies
the resulting schema and exits instead of starting an application server. It
prints the sanitized target mode, host, database, and user before any DDL; it
never prints the password. See
docs/persistence.md and
docs/runtime-asset-contract.md for the schema, auth model, backups,
failure behavior, and the one post-tofu apply value to pin.
New board-unit geometry has one supported entry point: python scripts/generate-unit-art.py, which renders the calibrated Blender turntable at
eight exact facings. Resizing already accepted art uses Unit Art's Recapture
editor instead: it deterministically reduces the approved 6-palette x 8-direction
set to the chosen delivery raster and creates a review-only storage-backed
candidate with explicit source and resampling provenance.
See docs/art/unit-concepts/README.md.
Checks
cd backend
npm test
The backend smoke-test exercises the Postgres-backed endpoints, so it needs a
Postgres. It uses DATABASE_URL if set, otherwise self-provisions a throwaway
local Postgres from system binaries (as on the GitHub-hosted CI runners). Hosts
without Postgres binaries should set DATABASE_URL. The smoke-test explicitly
runs with SCHEMA_MIGRATIONS=auto because its database is throwaway/reset.
Backend npm test builds the production shell exercised by its HTTP smoke test
and the DOM-free trainer bundle required by its solver smoke test, but does not
own frontend validation. The frontend gate runs without a database:
cd frontend
npm run check # node checks + vitest + tsc
CI comes from pipeline-templates' suites (its fleet.json entry, ADR-0645): on a pull
request the web-app suite runs each package's npm run lint and npm test (the backend
against a PostgreSQL service it starts) and builds the image and runs its --self-test,
each only when its inputs changed; a pull request that changes only Markdown runs only
the Markdown guards (.forgejo/workflows/checks.yaml).
Deploy
Forgejo owns CI and releases through pipeline-templates' suites (PIPT-12, ADR-0645). Azure retains the existing app registration through Forgejo OIDC; this application has no publish script or local publishing command.
The app is deployed from k8s/ on main by ArgoCD. Pull requests build and self-test
the image but publish nothing. A merge that changes the application releases the next
v0.1.N: the web-app suite pushes the image to ACR and opens a pin PR on main writing
its tag and digest and the build provenance (the release commit and the PR it merged)
into k8s/values.yaml, which merge-queue lands. No second release gesture is required
after merge.