d-cap / kalah

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Started

Description

This is an implementation of the Kalah game. The current implementation uses Spring Boot to serve the functionalities.

Run the application

KalahApplication is responsible for starting the web service.

To start the application you can use one of the following commands:

  • mvn spring-boot:run (Development environment only)
  • java -jar kalah-<version>.jar

Endpoints

Currently, there are two endpoints available with the POST http method:

  • One to create a gamehttp://<host>:8080/games
  • One to make a move http://<host>:8080/games/{gameId}/pits/{pitId}
    • gameId is generated by the application
    • pitId is fixed between game and should be in one of these two intervals: [1, 6] or [8, 13]

Package division

  • api contains the classes that are used to expose the game
  • api.response contains the classes used as a response for the APIs
  • game contains the actual logic for the game

Note

  • The file lombok.config is used to configure Lombok to expose the constructor properties' name to allow Jackson to deserialise the object into json.

About


Languages

Language:Java 100.0%