Skip to content

praisetompane/app_poker

Repository files navigation

app_poker

build status

  • a Poker hand evaluator.
    • currently only supports High Games:
      • features:
        • calculate highest hand rank possible for a 5 card hand.
        • calculate all possible hand ranks for a 5 card hand: response is stubbed

project structure:

  • docs: project documentation lives in here.

  • src: production code lives in folder and is divided in the modules below:

    • app_poker: project package
      • api:
        • the API to the application lives in this module.
        • the current implementation is a REST API, but a gRPC, CLI API, etc would be implemented in here.
      • config:
        • configurable values live in here.
        • these are values such as Hand Ranks, Card Ranks.
          • as the system scales, you could migrate these into a database to allow independently changing config without restarting the application.
      • core:
        • the domain logic of the application lives in this module.
      • gateway:
        • all external interaction objects(e.g. files, external APIs etc) live in this module.
      • model:
        • the domain models for Poker live in this in this module.
      • app_poker.py: entry point to startup the application
  • tests: test code lives in folder. the tests are intentionally separated from production code.

  • utilities: any useful scripts, such as curl & postman requests, JSON payloads, software installations, etc.

setup instructions:

  1. install python 3.11 or higher.

  2. clone repo:

    git clone git@github.com:praisetompane/app_poker.git

package management:

run program:

  • install packages into local environment using pipenv[only required for first run]:
    pipenv install
  • to start system run:
    ./start_system.sh

testing:

unit tests:

  • to run tests:
    • activate environment
    pipenv shell
    • run tests
    pytest

end to end tests:

development:

  • to run system in debug mode:
    ./start_system_development.sh
  • running in VSCode:
    • open the "Run and Debug" view:
    • click the green play button.
      • the server will inform you the host and port in the terminal output at the bottom.
      • from here you debug like normal(i.e. add break points, step into code definitions, evaluate code snippets, etc) start system output

git conventions:

demo:

0. start system output:

  • output: start system output

1. evaluate hand output:

  • request and response highest rank hand evaluation for Four of a Kind: four of a kind demo postman request
  • demo system state logs: four of a kind demo system state logs

Disclaimer: This is still work in progress.

About

a Poker hand evaluator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published