Lean Spring Boot baseline for game-oriented backend services.
Prerequisites:
- Java 21
- Docker Desktop
Start local dependencies:
docker compose up -d postgres keycloakRun the service quietly:
./scripts/run.shWindows:
.\scripts\run.cmdRun with debugger support on port 5005:
./scripts/run-debug.shWindows:
.\scripts\run-debug.cmdThe API will be available on http://localhost:8080.
This repository stays intentionally small and favors platform basics over premature feature work:
- deterministic Maven builds
- PR-based CI validation
- stateless OAuth2 resource-server security with Keycloak
- PostgreSQL persistence with Flyway migrations and Spring JDBC
- first local-dev gameplay session + authoritative movement slice
- role-based access control backed by JWT claims
- local operability with a minimal auth stack
- health probes and JSON auth failure responses
- Java 21
- Spring Boot 3.4
- Maven 3.9.14
- PostgreSQL
- Flyway
- Spring Security OAuth2 Resource Server
- Spring JDBC /
JdbcClient - Keycloak
- Springdoc / OpenAPI runtime docs
- Docker Compose
Implemented today:
- public and role-protected access probe endpoints
- local Keycloak realm import for repeatable token testing
- JWT validation with issuer, audience, and authorized-party checks
- Maven wrapper build and PR workflow validation
- published OpenAPI contract via
/v3/api-docsand Swagger UI - PostgreSQL wiring with SQL migrations and a
JdbcClientrepository baseline - authenticated gameplay session issuance for a local realtime boundary
- in-memory authoritative player movement over raw WebSocket
- coarse durable player location persistence for reconnect/recovery
Not yet implemented:
- combat, inventory, matchmaking, or broader game-domain modules
- replication beyond the moving player's own authoritative state
- dedicated realtime service or UDP transport
- deployment automation
./scripts/build.sh./scripts/test.shGitHub Actions runs the Maven build and test workflow for pull requests. Database-backed integration tests use Testcontainers and require a usable Docker environment.
docker compose up -d --buildThe local stack includes:
- the API on
http://localhost:8080 - PostgreSQL on
localhost:5432 - Keycloak on
http://localhost:8090
Public endpoints:
GET /api/pingGET /api/access/publicGET /actuator/healthGET /actuator/health/livenessGET /actuator/health/readinessGET /v3/api-docsGET /swagger-ui/index.html
Role-protected endpoints:
GET /api/access/userGET /api/access/adminPOST /api/gameplay/sessions
Contract endpoints:
GET /v3/api-docsGET /swagger-ui/index.html
- docs/wiki/auth.md: application security contract
- docs/wiki/auth-keycloak.md: local Keycloak flow
- docs/wiki/movement.md: first authoritative movement slice
- docs/plan.md: delivery roadmap
- docs/TODO.md: implementation backlog
- docs/CHANGELIST.md: engineering milestones
- docs/PROTOTYPE_REVIEW.md: current implementation assessment