Skip to content

jesperancinha/mancalaje

Repository files navigation

Coffee Cups Kalah


Generic badge GitHub release GitHub License

CircleCI Build status mancalaje

Codacy Badge codebeat badge Known Vulnerabilities

Codacy Badge codecov Coverage Status

GitHub language count GitHub top language GitHub top language


Technologies used

Please check the TechStack.md file for details.

Project status

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧 Under construction 🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

Introduction for the introduction

This game is a slight change from the typical Kalah game, where in this case I'll be using coffe mugs instead of stones. This way, more original will rules will be added. Stay tuned...

β˜•οΈ

To keep up with current changes, please have a look at the Rules documentation.

Note that the above will happen along with multiple other changes. Check out my planning document to follow up with the running changes...

Introduction

According to Ultraboard Games the mancala game has existed for about 7000 years. This means that since the middle neolithic phase of History, mankind has been playing this game.

This project is also the official support project of my article on medium:

Deploying Mancala with Minikube

Installation notes

yarn install
npm audit fix
npm install coveralls --save-dev

Docker Compose

I have provided a docker-compose environment that will run this application in your docker-machine addess.

Make sure that the docker-machine is correctly installed and that you set your environment to your machine.

All that needs top be done is to call the build.sh script with the name of the target docker-machine. In my case its ' dev'.

Example:

./build.sh dev

Startup

Backend

cd kala-game-service
mvn spring-boot:run

Note that I attempted to create this project with reactive programming and it is possible and it would be more efficient, however I had to rollback because of the amount of time it would take to complete it.

Frontend

cd packages/kala-game-web
npm start

Available users

Users are currently hardcoded and there are only two:

Username Password
player1 admin
player2 admin

cUrl

curl -i -H "Content-Type: application/x-www-form-urlencoded" -c cookies.txt  -d "username=player1&password=admin" -X POST http://localhost:8081/login
curl -i -b cookies.txt http://localhost:8081/user
curl -i -b cookies.txt -X POST http://localhost:8081/api
curl -i -b cookies.txt -X POST http://localhost:8081/api/create
curl -i -b cookies.txt -X PUT http://localhost:8081/api/move/16/2
curl -i -b cookies.txt -X PUT http://localhost:8081/api/move/16/3

curl -i -H "Content-Type: application/x-www-form-urlencoded" -c cookies2.txt  -d "username=player2&password=admin" -X POST http://localhost:8081/login
curl -i -b cookies2.txt -X PUT http://localhost:8081/api/join/16

Practical Example

Have a look at game.sh for a practical example, where player 1 wins.

This example relies on static Id's so you can only run it once after a restart.

  1. cookies.txt holds the session for player1
  2. cookies2.txt holds the session for player2

Front - End - Web application

In order to start the FE, you need to have NODE.JS installed.

Preferably try to install everything using Yarn.

yarn install

To start, go to kala-game-web and run:

npm start

Please check Ops documentation for more info on how to deploy in K8's.

System utility installation

  • Installing LCov
brew install lcov
apt-get install lcov
  • Merging reports
find packages -name lcov.info -exec echo -a {} \; | xargs lcov -o coverage/lcov.info

Yarn

yarn workspaces run coverage

Roadmap to version 2.0.0

The intention of version 2.0.0, is layed out for you in file Planning. Essentially the goal is to provide an efficient and running modified version of the original Kalah game.

References

NOTE: remember to use the powershell script if trying to install the Meslo fonts in windows (.ps1 file). It's located in the fonts repo.

About me

GitHub followers