Files
ttt/README.md
robi ec7b13ebd9 docs: note that project is managed by Hermes Agent (#2)
README update: project is now managed by Hermes Agent.

Reviewed-on: #2
Reviewed-by: Daniel Jircă <daniel.jirca@alecsa.design>
Co-authored-by: robi <robi@alecsa.design>
2026-09-30 10:45:33 +03:00

58 lines
1.4 KiB
Markdown

# Tic Tac Toe
A tic-tac-toe game with two modes: **CPU** (play against a CPU opponent that makes random moves) and **Online** (real-time 2-player over WebSocket).
## Management
This project is now managed by Hermes Agent.
## Stack
- Frontend: vanilla JS + CSS (no build step)
- Backend: Node.js + Express (serves static files) + `ws` (WebSocket) + `sql.js` (SQLite, file-based persistence)
## Project layout
```
public/ frontend (index.html, app.js, game.js, multiplayer.js, style.css)
server/ backend (server.js, db.js, package.json, pnpm-lock.yaml)
docs/ design docs
Dockerfile production image
docker-compose.yml
```
## Run locally
The backend lives in `server/` (the frontend has no build step).
```bash
# install backend deps (pnpm)
cd server && pnpm install
# start (default port 8080)
node server/server.js
# or with an explicit port
PORT=8080 node server/server.js
```
Then open <http://localhost:8080/>.
> The server reads `PORT` (default `8080`) and optional `BASE_PATH` (default empty).
## Run with Docker
```bash
docker compose up --build
```
or build and run the image directly:
```bash
docker build -t tictactoe .
docker run -p 8080:8080 tictactoe
```
Then open <http://localhost:8080/>.
## Notes
- `server/data/` holds the SQLite file and is git-ignored.
- Online games persist to SQLite; a host who reloads can re-enter via the saved token.