Skip to content

Web App that tracks Poker tournaments, scores and leaderboards

License

Notifications You must be signed in to change notification settings

dannytrigo/django-pokerscores

 
 

Repository files navigation

Build Status License

Poker Leaderboard App

Data

League

  • name
  • List[User]
  • List[Player]
  • List[Season]

User

  • name
  • email
  • password
  • League

Player

  • name
  • email
  • Scores (tournaments played)

Season

  • name
  • League
  • start date (optional)
  • end date (optional)
  • List[Tournament]
  • active
  • visible

Tournament

  • name
  • start date (optional)
  • end date (optional)
  • League
  • Optional[Season]
  • List[Score]
  • ScoringSystem

Score

  • Player
  • points
  • Tournament

ScoringSystem

  • name
  • List[int] - points per place

TODO: History

  • Score history (something)

Leaderboard

  • select a season
  • select a tournament (optional)
  • show Players with their total Scores in the Season (and Tournament, optional)
  • sort players by rank or by name

Steps

Setup environment

virtualenv virtualenv
source ./virtualenv/bin/activate
pip install -r requirements.txt

Starting Database container

Prerequisites

  • Docker
  • Vagrant
  • psql utility (on CentOS this is in the postgresql package)

Start the docker container using Vagrant

vagrant up

Connect to the container using psql. Note this uses a dev password. Definitely don't use this in production.

PGPASSWORD=PokerScores123 psql -h localhost -U django pokerscores

Create the project

NOTE All following steps assume you're in the pokerscores/ directory and have the virtualenv/ activated.

YOU DON"T NEED TO DO THIS STEP. This is how i setup the project initially.

django-admin startproject pokerscores
DATABASE_PASSWORD=PokerScores123 python manage.py startapp api

Initialize the database

NOTE Only need to do this on the first run.

DATABASE_PASSWORD=PokerScores123 python manage.py migrate

Run the test server (dev only)

DATABASE_PASSWORD=PokerScores123 python manage.py runserver

Test out the site by going to http://localhost:8000/api

Editing models

Edit yoor model code

Creating migrations

DATABASE_PASSWORD=PokerScores123 python manage.py makemigrations api

Run the migrations, note the number will be created above and will be different that 0001

DATABASE_PASSWORD=PokerScores123 python manage.py sqlmigrate api 0001

About

Web App that tracks Poker tournaments, scores and leaderboards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 34.7%
  • Python 34.4%
  • TypeScript 27.1%
  • Makefile 1.8%
  • JavaScript 1.5%
  • CSS 0.5%