A complete Tak game server implementation in Go with REST API, database persistence, and comprehensive game logic.
GoTak is a production-ready server for the board game Tak, providing:
- Complete Tak Game Logic: Full implementation of official Tak rules including road detection, piece limits, and win conditions
- PTN Support: Parse and generate Portable Tak Notation (PTN) for game recording and replay
- REST API: HTTP endpoints for game creation, move submission, and state retrieval
- Database Persistence: PostgreSQL storage with automatic migrations
- Web Interface: Dynamic home page with endpoint documentation
- Developer Tools: Comprehensive testing, Swagger documentation, and CI/CD integration
The project includes three main applications:
- Web Server (
./cmd/server) - Production HTTP API server - CLI Tool (
./cmd/gotak) - Command-line game demonstration - PTN Parser (
./cmd/parse-ptn) - Parse and validate PTN files
# Set database connection
export DATABASE_URL="postgres://user:password@localhost/gotak?sslmode=disable"
# Start the server
go run ./server
# Or build and run
go build -o gotak-server ./server
./gotak-serverThe server will start on port 8080 and automatically run database migrations.
# Run all tests with coverage
go test -v -cover ./...
# Run specific package tests
go test -v ./server# Build the main CLI tool
go build -o gotak ./cmd/gotak
# Build the PTN parser
go build -o parse-ptn ./cmd/parse-ptn
# Build the server
go build -o gotak-server ./servercurl -X POST http://localhost:8080/game/new \
-H "Content-Type: application/json" \
-d '{"size": "8"}'curl -X POST http://localhost:8080/game/{slug}/join \
-H "Authorization: Bearer YOUR_TOKEN"curl -X POST http://localhost:8080/game/{slug}/move \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"player": 1, "move": "a1", "turn": 1}'curl http://localhost:8080/game/{slug}- Core Logic: Game rules, board state, and PTN parsing in root
*.gofiles - Server: HTTP API with Chi router, middleware, and PostgreSQL storage
- Database: Schema with games, moves, and tags tables
- Security: Input sanitization, CORS, security headers
- Documentation: Auto-generated Swagger docs with GitHub Actions integration
See CLAUDE.md for detailed development commands and architecture information.
- PTN-Ninja - PTN notation and game analysis
- PlayTak.org - Online Tak platform
- Taktician - Tak AI implementation
- Tak Subreddit Wiki - Rules and notation references
- Official Rules of Tak