Skip to content

Mancala game for two players using Java, JavaScript, Spring, Redis and WebSockets

Notifications You must be signed in to change notification settings

karle0wne/mancala-game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mancala Game

Java Test Assignment

Game screenshot

How to Play

  1. Run docker compose up.
  2. Open localhost:8080 in your browser—this is the first player’s game perspective.
  3. Create a new game and copy game ID from an input field.
  4. Open localhost:8080 in another browser tab—this is the second player’s game perspective.
  5. Paste game ID in an input field and click Connect.
  6. The game has started. Use board buttons to make turns. Switch browser tabs to switch between players.

Reasoning Behind Technical Decisions

  1. Domain objects are immutable—thus they’re thread safe and easy to reason about.
  2. Game logic is presented as a set of rules, connected into a Chain of Responsibility. It allows us to keep the code neat and clean and to test small chunks of logic separately.
  3. Redis is used to store game state as a serialized string. If at some point we need more sophisticated approach (e.g. to search games by their status), we may want to switch to MongoDB or even to RDB.
  4. Frontend is quite primitive—it’ll be easy to switch to a prettier one because API is documented with Swagger.
  5. In a production environment we’ll want to pay attention to API’s security. However, I decided that this topic is out of this assignment’s scope.

About

Mancala game for two players using Java, JavaScript, Spring, Redis and WebSockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 89.8%
  • HTML 5.0%
  • JavaScript 4.9%
  • Other 0.3%