StoneSync is a standalone, local-first online two-player Go (Weiqi/Baduk) web application featuring authoritative server-side rule validation, real-time WebSocket room multiplayer, Sensei AI Positional Evaluation, host moderation controls, top bar MP3 music player, and a responsive HTML5 Canvas interface.
- Board Sizes: 19x19, 13x13, and 9x9 canvas grids.
- Rule Validation: Group liberty tracking, suicide rejection, Positional & Situational Superko rules.
- AI Sensei Evaluation Engine (
server/evaluator.py): Real-time win-rate calculation, score lead telemetry (#score-lead-badge), and top tactical move recommendations with canvas overlay pins (①,②,③). - Scoring Modes: Japanese Territory (
territory + captures + komi) & Chinese Area Scoring (living_stones + territory + komi). - Time Control System: Fischer increment, Byo-yomi periods, Absolute time controls, and untimed matches.
- SGF Engine (
server/sgf.py): Full round-trip SGF game record export (/api/room/{roomId}/sgf) and file parsing.
- Host Permissioning: Room creator automatically assigned as room
host_id. - Clock Controls: Live
⏸️ Pause Clockand▶️ Resume Clockmatch timer management. - Occupant Moderation: Dropdown user selection with instant
Kickaction. - Game Adjudication: Manual winner declaration (
👑 Black Wins/👑 White Wins) and point score override. - Room Privacy Lock: Set room passwords and toggle privacy locks (
🔒 Lock Room).
- Integrated MP3 Player Widget: Compact glassmorphic pill in top navigation bar with play/pause, skip, and live timestamp ticker.
- Isolated Audio Architecture:
frontend/music/: Dedicated folder for MP3 music tracks automatically scanned via/api/audio-tracks.frontend/go-sounds/: Dedicated folder for Go board stone impact WAVs (GoGame-Thwack1.wav..4) and capture MP3s (GoGame-PieceRemoved.mp3).
- Japanese Slate & Shell Textures: Procedural clam shell growth lines on White stones and slate micro-grain on Black stones.
- Zen Ambient Soundscape: Low-pass filtered rain generator with rhythmic bamboo fountain (Shishi-odoshi) click.
- Visual Territory Heatmap: Toggleable overlay showing real-time territorial influence gradients across board intersections.
stonesync/
├── server/
│ ├── app.py # FastAPI application server, static routing & REST endpoints
│ ├── go_game.py # Authoritative Go rules engine (scenarios, liberties, superko)
│ ├── go_server.py # WebSocket room manager, player roles & admin actions
│ ├── evaluator.py # Real-time AI win-rate & tactical move evaluation engine
│ ├── sgf.py # SGF format parser & exporter
│ └── agents/ # StoneBot AI Opponent agent bridges
├── frontend/
│ ├── go.html # Main web app layout, Sensei AI card & Admin Panel UI
│ ├── go.css # Dark mode design system & glassmorphism
│ ├── go.js # Canvas board renderer, Web Audio API & WebSocket client
│ ├── assets/ # QR codes and image assets
│ ├── music/ # MP3 music tracks for top bar player
│ └── go-sounds/ # Board interaction WAV and MP3 sound effects
├── tests/
│ ├── unit/ # Python backend engine unit tests (21 test cases)
│ └── e2e/ # Playwright E2E automation tests (Node.js & Python specs)
├── docs/
│ ├── FEATURES.md # Detailed feature specifications
│ ├── ROADMAP.md # Project roadmap & build milestones
│ └── BUILD_ROADMAP.md # Architecture & GitHub task breakdown
├── scripts/
│ ├── gen_sounds.py # Audio sound asset generator script
│ └── release_tag.sh # Git release tagging helper
├── Dockerfile # Production container build recipe
├── docker-compose.yml # Standalone local/production Compose file
├── playwright.config.js # Playwright E2E configuration & webServer manager
├── requirements.txt
├── package.json
├── README.md
├── LICENSE
└── .gitignore
# 1. Create a Python virtual environment
python3 -m venv .venv
# 2. Activate the virtual environment
source .venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Start the FastAPI server
uvicorn server.app:app --host 0.0.0.0 --port 8080
# 5. Open in browser: http://localhost:8080/go# Build and launch StoneSync in detached mode
docker compose up --build -d
# Live File Development with Docker Compose Watch
docker compose watch
# Open in browser: http://localhost:8080/goThe develop.watch section enables automated live development:
- Frontend Changes (
./frontend): Real-time sync to/app/frontend(no container restart required). - Server Engine Changes (
./server): Real-time sync to/app/serverwith automatic Uvicorn app server restart. - Python Dependencies (
./requirements.txt): Triggers an automated container image rebuild.
PYTHONPATH=. .venv/bin/pytest -v# Execute Node.js Playwright suite
npx playwright testThis project is licensed under the MIT License - see the LICENSE file for details.