Skip to content

Tic-Tac-Toe game on web application with AI-player on Monorepo using bun

Notifications You must be signed in to change notification settings

saenyakorn/tic-tac-toe

Repository files navigation

Tic Tac Toe

This repository contains a simple implementation of the game Tic Tac Toe. It's included Web application and a REST API in full stack framework.

The Web application is built with Next.js and Bun with AI-player trained with Minimax Algorithm.

Screenshots

Demo Demo Demo

Local Installation

  1. Clone the repository

    git clone git@github.com:saenyakorn/tic-tac-toc.git
    
  2. Install dependencies

    bun i
    
  3. Prepare the environment variables, database, and code generation

    cp .env.sample .env
    # Prepare MySQL database
    docker compose up -d
    bun prisma db push
    # Prisma code generation
    bun prisma generate
    

    You can change the environment variables in .env file.

  4. Run the application as a dev server

    bun dev
    

    The application will be running on http://localhost:3000

  5. Train the model

    curl -X POST http://localhost:3000/api/game/ai/train
    

    This step might take 4-6 hours to complete

About

Tic-Tac-Toe game on web application with AI-player on Monorepo using bun

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published