Api to get possible moves of Chess Pieces based on current position.
Given a knight located on a coordinate chosen by the user find out all possible locations where the knight can move in 2 turns. You are expected to build an API.
The api should:
- receive cell coordinate (in Algebraic notation) and return an array with all possible locations where the knight can move within 2 turns
Some bonus points for implementing them correctly:
- add docker/docker-compose ✅
- allow user to dynamically add rows/columns to the chessboard ✅ (max 26x26 [a-z])
- save logs of all requests and results in a database ✅
- /
- /admin/
- /api/
- knight/
- moves/
- knight/
Clone project:
git clone https://github.com/philippeoz/chess_moves.git
- Install docker
- Install docker-compose
cd chess_moves
to enter in project path.docker-compose up --build
ordocker-compose --build -d
(daemon)
- Install Postgresql and create a database (let's say the name is
database
). - Install Pipenv:
pip install pipenv
- Enter in project dir:
cd myprofile
pipenv install
cd app
- Inside the 'app' dir, create a file
settings.ini
with the following configs:There are more environment variables that can be configured in the[settings] DEBUG=True DATABASE_URL=postgres://username:password@host/database
settings.ini
, see more on settings module. - From here you can choose to enter virtualenv with
pipenv shell
or execute commands outside withpipenv run python ...
, the example will be outside, inside just remove thepipenv run
. pipenv run python manage.py migrate
pipenv run python manage.py runserver
- Add all Chess Pieces
- More endpoints/functions for pieces
- More Tests
- Improvements for better performance (something with asyncio maybe)