Skip to content

Deterministic Tic Tac Toe agent with a React UI and Node/Express API. Uses minimax to select optimal moves, runs fully on CPU, and provides a clean full‑stack demo with a simple /move endpoint.

Notifications You must be signed in to change notification settings

sparkup/tic-tac-toe-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe Agent

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.

Project Overview

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.

Live Demo

Current working demo version

The live demo showcases the current minimax-powered gameplay experience. This repository focuses on the code and architecture rather than deployment.

What This Project Is / Is Not

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

Repository Structure

backend/             # Express API + minimax logic
frontend/            # React UI
stack.yml            # Optional stack definition (Traefik)
docker-compose.yml   # Local dev orchestration

API

POST /api/v1/move

Request:

{
  "board": ["X", null, "O", null, "X", null, null, null, "O"]
}

Response:

{
  "move": 5,
  "score": 8,
  "evaluation": { "winner": null, "line": [] }
}

Local Development

docker compose up --build

Frontend: http://localhost:5173 Backend: http://localhost:8080/api/v1/healthcheck

Environment Variables

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

License

MIT License

About

Deterministic Tic Tac Toe agent with a React UI and Node/Express API. Uses minimax to select optimal moves, runs fully on CPU, and provides a clean full‑stack demo with a simple /move endpoint.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published