Coder Social home page Coder Social logo

tic-tac-toe_game_backend's Introduction

Tic-Tac-Toe_Game_Backend

Welcome to Tic Tac Toe REST API. Tic Tac Toe is a two-player game where opponents take turns marking an empty cell in a 3ร—3 grid with their respective symbols ("X" or "O"). The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is declared the winner. This API implementation utilizes Spring Boot for the backend, MySQL for data storage, and AWS for hosting.

Features

  • Player can register using unique name
  • Registered players can start game
  • Ongoing games can reset
  • Active players can play there turn

API Endpoints (Postman collection):

     http://54.81.209.157/

API Reference

- Register Players

  POST /api/player/register
Req. Body Type Description
playerName string Unique Player names only can register.

- Start Game

  POST /api/game/start
Req. Body Type Description
playerName string Registered players only can start.

- Reset Game

  PATCH /api/game/reset/{playerName}
Req. Parameter Type Description
playerName string Active players only can restart.

- Play a Turn

  POST /api/game/playerTurn
Req. Body Type Description
playerName string Registered players only can start.
row int Placed 'X' in player Wanted.
column int Placed 'X' in player Wanted.

Run Locally

Clone the project

  git clone https://github.com/KRMadhusanka99/Tic-Tac-Toe_Game_Backend.git

Go to the project directory

  cd my-project

Start as normal spring boot application.

Running Tests

Use Postman to check API Endpoints. All Endpoints' description has mention above.

Support

If any case the host services not working properly you can download my code from GitHub using the above-mentioned URL, extract and run it as a normal spring boot app. Then for API calling use http://localhost:8080 or the port that your computer has given rather than using the IP address I mentioned above.

Furthermore, I used a hosted database as well, so if any case the database not working as expected, you need to change the application.properties class to your local database configurations. I already commented on code lines for your easiness.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.