Take-home assignment where the only given requirement was to expose a REST API for scoring bowling. No skeleton/base was provided. Used Django since I've used it before and Tastypie since I haven't used it before. Meant to represent 4~6 hrs work.
poetry installto install all dependencies (prerequisite: install Poetry)- For contributing:
poetry run pre-commit installto install pre-commit git hooks poetry run python manage.py migrateto run migrations
poetry run python manage.py runserverto run apipoetry run python manage.py testto run tests
HATEOAS-supported REST API: http://localhost:8000/api/v1/?format=json
Typical use involves five steps:
- Create a player
- Create a game
- Create a roll
- Get the updated game (with scores)
- Repeat steps three and four
Game.frame_scores has the running scores for each frame as available, or if individual frame scores aren't needed, Game.total_score has just the total score.
Note: aliased poetry run python manage.py as pm
pm testto run testspm shell_plusfor an interactive shellpm reset_dbto reset local dbpm createsuperuserto create admin credentials