Git Product home page Git Product logo

league's Introduction

League

Latest Release Build Status Updates Python 3

A go league app.

Quickstart

Install system deps

brew install pyenv pyenv-virtualenv npm postgresql
pyenv install 3.4.5
pyenv virtualenv 3.4.5 league
npm install -g bower

Set your app's secret key as an environment variable. For example, add the following to .bashrc or .bash_profile.

export LEAGUE_SECRET='something-really-secret'

Before running shell commands, set the FLASK_APP and FLASK_DEBUG environment variables

export FLASK_APP=app/autoapp.py
export FLASK_DEBUG=1

Then run the following commands to bootstrap your environment

git clone https://github.com/massgo/league
cd league
pyenv activate league
pip install -r app/requirements/dev.txt
bower install
flask run

You will see a pretty welcome screen.

Once you have installed your DBMS, run the following to create your app's database tables and perform the initial migration

flask db init
flask db migrate
flask db upgrade
flask run

Deployment

In your production environment, make sure the FLASK_DEBUG environment variable is unset or is set to 0, so that ProdConfig is used.

Shell

To open the interactive shell, run

flask shell

By default, you will have access to the flask app.

Running Tests

To run all tests, run

flask test

Migrations

Whenever a database migration needs to be made. Run the following commands

flask db migrate

This will generate a new migration script. Then run

flask db upgrade

To apply the migration.

For a full migration command reference, run flask db --help.

Slack integration

To add Slack integration, set the SLACK_WEBHOOK and SLACK_CHANNEL environmental variables

export SLACK_WEBHOOK='your-slack-webhook'
export SLACK_CHANNEL='your-slack-channel'

league's People

Contributors

hndrewaall avatar hwchen avatar mattclarke131 avatar njritter avatar pyup-bot avatar wisygig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

league's Issues

Add personal player pages

We should add views for individual players. These can live under /players/<player_id>. These should include player game histories and statistics.

Enable CSRF protection

There are two levels of CSRF protection in place, and both are manually disabled everywhere. We should decide if we even need both of these, and remove the overrides.

Additionally, where appropriate, we should conditionally disable these based on test config

Investigate task queuing

We will soon need the ability to schedule and queue jobs. Some examples of things we might want it to handle:

  • Sending email
  • Manage backups
  • Perform statistical computations (update ratings etc.)
  • Generate graphs

Some ideas for software:

Identical playtimes

Currently it is possible for games to have identical play timestamps. Since we rely on these to provide a strict ordering, we should enforce uniqueness at the DB level. Moreover, we should provide validation at the API and UI levels.

Example of duplicate timestamps:

image

Reorganize views to separate RESTful routes

After #53, we now have some RESTful routes that are mixed in with templated views. These should be moved to their own namespace, something like /api/v1.0, along with their own subdirectory.

Reenable login/registration pages, protect all dashboard pages

All of the user registration/login forms and routes are currently disabled or have been removed. We need to reenable these, and mark all dashboard pages as requiring authentication to view.

As part of this effort, we should also reenable the public homepage and clean it up.

Timezone issue

Running this with Andrew's laptop set to west coast time seems to have inconsistent handling of time zones. Affects time played, created, and modified

Initial Update

Hi ๐Ÿ‘Š

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! ๐Ÿค–

Add Slack integration

A basic (and useful) Slack integration would be to simply post game results as they are added (much like @njritter already does manually)

Errors are not displayed in games view

The new games view introduced in #53 does not display errors (such as validation errors) from AJAX requests. This will involve adding a new element, either a modal or a "traditional" bootstrap alert, based on the result of AJAX requests. This should be done before implementing this new interface for Users or Players

Add new metrics to dashboard

Some new metrics:

  • Kyu Killer - defeats of kyu players by a dan players
  • Dan Demolisher - defeats of dan players by kyu players
  • Stoned - handicap stones given

Should be enough to just add to template and episode_stats function

Player/game deletions only delete last item checked

Both player and game pages have checkbox-based delete functions, but both only respect the last item selected. This is due to the form submitting multiple player_id parameters with the POST, but the PlayerCreateForm and GameCreateForm only defining that parameter as a single item. This should theoretically be fixable using a FieldList but I haven't yet gotten it working.

Allow dynamic GUI config of Slack integration

We should add a view for managing Slack config to the Admin settings page. Should include button/route for sending test message. Should retain backwards compatibility for initializing values from env vars

Authentication sometimes fails silently

I've seen this recently on mobile, and I'm pretty sure also at least once with the full version. Authentication seems to just silently fail. Logging shows the POST, but I don't see any error codes. Current prod logging isn't really sufficient to debug this.

Add persistence for configuration settings

We can edit slack configuration variables after #97, but the current method of changing these variables does not persist over different server sessions.

For this configuration data, when would be the appropriate time to read this data? The current structure of the application factory doesn't have a clean insert point (configuration data is read from the environment before the database is activated).

Per-player current episode/season not updating

image

^ The above shows player view after episode 3 has started. Should show 0-0 for current episode. Probably just because we are computing latest episode/season locally to player rather than globally.

Release management

Currently, we simply tag docker images as latest and do no git version tagging whatsoever. We should find a tool and/or build a script to write/update a VERSION file, tag the repo, and tag the docker images built appropriately. Once this is done, we can start managing releases using terraform (as opposed to manually terminating ECS tasks).

About Page

We really need an about page for league with at least.

  • Overview
  • Rules

Games view shows unfiltered table briefly

The new games view introduced in #53 "seeds" the table using the templater to inject rows as HTML. This results in an unformatted table occasionally being briefly visible as the page loads. We should move this template seeding into the JS block of the template, so we still get the rows without an additional request, but the table loads all at once.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.