A small, deterministic Tic Tac Toe agent with a React frontend and a Node/Express API. The AI uses minimax and runs entirely on CPU.
This project demonstrates a clean, full-stack setup for a classic game agent. The backend exposes a single /move endpoint that evaluates the board and returns the best move. The frontend provides multiple play modes and a polished UI.
The live demo showcases the current minimax-powered gameplay experience. This repository focuses on the code and architecture rather than deployment.
This project is:
- A lightweight game AI demo using minimax
- A full-stack example with a React UI and Express API
- A deterministic, CPU-only agent (no external model hosting)
This project is not:
- A reinforcement learning system
- A multiplayer game server
- A production-grade deployment
backend/ # Express API + minimax logic
frontend/ # React UI
stack.yml # Optional stack definition (Traefik)
docker-compose.yml # Local dev orchestration
POST /api/v1/move
Request:
{
"board": ["X", null, "O", null, "X", null, null, null, "O"]
}Response:
{
"move": 5,
"score": 8,
"evaluation": { "winner": null, "line": [] }
}docker compose up --buildFrontend: http://localhost:5173
Backend: http://localhost:8080/api/v1/healthcheck
Create a .env file if you want to override defaults. Example values:
VITE_API_BASE_URL=http://localhost:8080
VITE_PUBLIC_URL=tic-tac-toe-agent.demo.sparkup.dev
VITE_LOCAL_URL=tic-tac-toe-agent.demo.sparkup.local
MIT License