Skip to content

Automated Tic-Tac-Toe game using Spring WebSockets for server-client interaction

License

Notifications You must be signed in to change notification settings

brzzznko/TicTacToe

Repository files navigation

Tic-Tac-Toe Game with Spring WebSockets

build status badge Codacy Badge Codacy Badge

This project implements a Tic-Tac-Toe game using Spring Boot and WebSocket technology.
It consists of two instances, a server and a client, which communicate with each other over WebSocket connections and playing the game automatically. Instances are able to reconnect and continue playing from the state where the other instance left off.

Getting Started

Running with Docker Compose

  • Clone the repository:
    git clone https://github.com/brzzznko/TicTacToe.git
    
  • Navigate to the project directory:
    cd TicTacToe
    
  • Build app with gradle:
    ./gradlew build
  • Run docker compose:
    docker-compose up --build

Running Locally with Gradle

  • Clone the repository:
    git clone https://github.com/brzzznko/TicTacToe.git
    
  • Navigate to the project directory:
    cd TicTacToe
    
  • Run server instance with gradle:
    ./gradlew bootRun --args='--spring.profiles.active=server'
  • Run client instance with gradle:
    ./gradlew bootRun --args='--spring.profiles.active=client'

Modifying Application Properties

You can modify the application properties to adjust the steps delay, running port, and server destination URL.

Checking game state

You can access the /state endpoint to see the current game state.

About

Automated Tic-Tac-Toe game using Spring WebSockets for server-client interaction

Topics

Resources

License

Stars

Watchers

Forks