Initial scaffold: Nakama backend, Godot client, content schema

Sets up the Step 1 (Project Foundation) and Step 2 (Content Schemas) scaffold
from the implementation sequence. Includes Docker Compose stack, Nakama
TypeScript module stubs, PostgreSQL migration, Godot 4 project shell with
scene stubs and NakamaClient singleton, YAML content schemas for all entity
types, and example data for 3 characters, 2 jobs, and all 7 core resources.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
caoimhinr 2026-06-02 23:33:06 +02:00
commit fb00954954
37 changed files with 2730 additions and 0 deletions

75
docker-compose.yml Normal file
View file

@ -0,0 +1,75 @@
services:
# Nakama game backend
nakama:
image: heroiclabs/nakama:3.22.0
container_name: xyvera_nakama
depends_on:
cockroachdb:
condition: service_healthy
entrypoint:
- "/bin/sh"
- "-ecx"
- >
/nakama/nakama migrate up --database.address root@cockroachdb:26257/nakama &&
/nakama/nakama
--name xyvera
--database.address root@cockroachdb:26257/nakama
--socket.server_key "${NAKAMA_SERVER_KEY:-xyvera-dev-key}"
--session.token_expiry_sec 7200
--runtime.path /nakama/data/modules
--logger.level DEBUG
volumes:
- ./nakama/modules:/nakama/data/modules
- nakama_data:/nakama/data
ports:
- "7349:7349" # client API
- "7350:7350" # gRPC API
- "7351:7351" # console UI
environment:
NAKAMA_SERVER_KEY: "${NAKAMA_SERVER_KEY:-xyvera-dev-key}"
restart: unless-stopped
# CockroachDB — required by Nakama
cockroachdb:
image: cockroachdb/cockroach:v23.2.3
container_name: xyvera_cockroachdb
command: start-single-node --insecure --store=attrs=ssd,path=/var/lib/cockroach/
volumes:
- cockroach_data:/var/lib/cockroach
ports:
- "26257:26257"
- "8080:8080" # CockroachDB admin UI
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
restart: unless-stopped
# PostgreSQL — game content, player state, and economy data
# Separate from Nakama's CockroachDB so schema migrations are clean and
# standalone from the Nakama-managed tables.
postgres:
image: postgres:16-alpine
container_name: xyvera_postgres
environment:
POSTGRES_DB: xyvera
POSTGRES_USER: xyvera
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-xyvera-dev-pass}"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U xyvera -d xyvera"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
nakama_data:
cockroach_data:
postgres_data: