Commit Graph

8 Commits

Author SHA1 Message Date
0903f61455 docs: describe the Java backend
The backend README, how to run and test it, what is easy to get wrong
with the game loop and the shared data formats, and the deployment note.
The web app was played against it in Chrome: a full game with a
spectator, a reload, a restart mid-game, the replay and a game lost on
time.
2026-10-16 11:53:13 +03:00
6aeff37eb8 feat(backend): replace the Node backend with the Quarkus backend
The Quarkus project moves to apps/backend and the Express sources go.
The image is built from the repo root as before, with Temurin 25, and
runs as a non-root user on port 6000. Compose passes the database as a
JDBC URL with the same MANCALA_DB_PASSWORD.
2026-10-16 11:47:40 +03:00
0c112eb716 feat(backend): serve the WebSocket protocol and the HTTP API
RtmtServer ports the WebSocket protocol (auth handshake, sockets per
user, ping) and runs on the game loop; the websockets-next endpoint at /
only forwards socket events. The HTTP routes, CORS and the access log
match the Express app. Backend wires everything and restores live games
before handling socket events. End-to-end tests play games over real
sockets against Postgres and Valkey.
2026-10-16 11:33:07 +03:00
d86fca8c54 feat(backend): save games in Postgres and live state in Valkey
The Node backend's migrations, runner, queries, keys and JSON, so the
same database and Valkey serve either backend. Integration tests run
Postgres and Valkey with Quarkus Dev Services, including a game row the
Node backend wrote and an unreachable Valkey.
2026-10-16 11:26:28 +03:00
219b50b491 feat(backend): port the game logic to Java
GameManager, matchmaking, the game clock, live game snapshots, saving
finished games and live previews, ported from the Node backend with its
tests. Snapshots keep the Node backend's format; a test restores one the
Node backend wrote. Valkey writes and saves run off the game loop.
2026-10-16 11:23:35 +03:00
f0246cca61 feat(backend): add the wire types, the game loop and token verification
Records for the JSON the clients read, leaving out only the fields
TypeScript leaves undefined. GameLoop is the single thread that owns live
state; ManualScheduler replaces Jest's fake timers in tests. Keycloak
tokens are verified with jose4j and the same checks as before.
2026-10-16 11:09:16 +03:00
f0ffd6ba87 feat(backend): add the Quarkus project with a Java port of the engine
Quarkus 3.40 on Java 25, built with the Maven wrapper. The engine is a
line-by-line port of packages/mancala.js; a parity test replays games
recorded with the TypeScript engine, including illegal moves, and
compares every board, turn, error and the game JSON.
2026-10-16 11:06:43 +03:00
ec833b4ec5 docs(backend): spec the move to Java and Quarkus
Requirements, design and tasks for rewriting the backend in Java 25 with
Quarkus while keeping the protocol, the API and the stored data.
2026-10-16 11:00:44 +03:00