Skip to content

kkudose/bowling-api

Repository files navigation

About

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.

 

Setup

  • poetry install to install all dependencies (prerequisite: install Poetry)
  • For contributing: poetry run pre-commit install to install pre-commit git hooks
  • poetry run python manage.py migrate to run migrations

 

Use

  • poetry run python manage.py runserver to run api
  • poetry run python manage.py test to run tests

HATEOAS-supported REST API: http://localhost:8000/api/v1/?format=json

Typical use involves five steps:

  1. Create a player
  2. Create a game
  3. Create a roll
  4. Get the updated game (with scores)
  5. 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.

 

Other

Note: aliased poetry run python manage.py as pm

  • pm test to run tests
  • pm shell_plus for an interactive shell
  • pm reset_db to reset local db
  • pm createsuperuser to create admin credentials

About

A sample interview take-home.

Topics

Resources

License

Stars

Watchers

Forks

Languages