This repository contains a full-stack implementation of the Codenames board game, featuring a Go backend, a Svelte 5 static frontend, and an AI player based on Word2Vec.
-
Backend (Go)
cmd/: Entry points for services and tools.codenames-server/: Main HTTP API server.ai-server/: AI player service.codenames-local/: CLI tool for playing locally.
codenames/: Core domain types and interfaces.embedding/: Experimental embedding-based AIweb/: HTTP handlers and WebSocket logic.game/: Game logic implementation.sqldb/: SQLite database implementation.vision/: Cloud Vision API integration for board parsing.
-
Frontend
frontend/: SvelteKit (Svelte 5) application (Newer/Experimental).
- Build Services:
go build ./cmd/codenames-server go build ./cmd/ai-server
- Run Tests:
go test ./...
Located in frontend/.
- Install Dependencies:
pnpm install - Dev Server:
pnpm run dev - Check Types:
pnpm run check - Lint:
pnpm run lint
-
API Design:
- RESTful endpoints for CRUD actions (User, Game creation).
- WebSockets for real-time game state updates (
/api/game/{id}/ws). - See
web/README.mdfor detailed API docs.
-
Database:
- Uses SQLite (
sqldb) for persistence. memdbavailable for in-memory testing.
- Uses SQLite (
-
AI Integration:
- Uses
word2vecmodels for word associations. - Requires external model files (GoogleNews vectors or Project Gutenberg).
- Stored in the
data/directory
- Stored in the
- See
w2v/README.mdfor model acquisition instructions.
- Uses
- Containerization:
Dockerfile.websrvDockerfile.aisrv
- Production: Deploys to
https://codenames.ai, currently done manually