GithubHelp home page GithubHelp logo

leafarlins / gokopa Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6.79 MB

Gokopa's world page

Home Page: https://gokopa.leafarlins.com

Python 55.47% CSS 3.20% HTML 39.81% Dockerfile 0.14% Procfile 0.01% Shell 0.36% Roff 1.01%
flask css docker html python

gokopa's Introduction

gokopa

Gokopa is a soccer tournament simulated by videogame, with tables, statistics, rankings.

This is an app to allow users to bet in the Gokopa's games. It could be adapted for beting in other championships.

Create venv: pip install -r requirements.txt

Work in the environment: source venv/bin/activate To leave: deactivate

Generate requirements: pip freeze > requirements.txt

Database

The database is creating importing the files in dataset, using flask commands.

The database used is a mongodb server.

Create the vars in .env file with

FLASK_APP=app/app.py
FLASK_ENV=development
MONGO_URI="mongodb+srv://...
SECRET_KEY="somesecretkey"

Load the dataset for past games with last db dump files, in dataset/dump.

Execute initial script for this version.

cat dataset/initial_db | sh

Or migrate using the corresponding file in dataset/migrations, when upgrading.

Initialize app and create users

Create users for the app. For each user:

flask user addUser <username> <name>

Activate user in app and/or in gokopa score board.

flask user activeUser <name> active true
flask user activeUser <name> gokopa true

Update app games

Set final score for each game

flask jogos editJogo 20 1 placar 0 1
flask jogos editJogo 20 2 placar 2 2
flask jogos editJogo 20 2 tr 1 1
flask jogos editJogo 20 2 pe 2 3
flask jogos editJogo 20 3 placar 1 2
flask jogos editJogo 20 3 tr 1 1

Set classified (replace team in each description). Examples:

flask time editTime Islândia p3A-EUR
flask time editTime Áustria p2B-EUR

Run command to create score history of the day

flask config setHistory

Deploy in production

Made using docker-compose template and docker containers.

gokopa's People

Contributors

leafarlins avatar

Stargazers

Andrei avatar

Watchers

 avatar

gokopa's Issues

Erro na desclassificação de time

Ao processar moedas ocorre erro caso o time da tabela processapat não exista.

Ao desclassificar time no jogo das moedas, verificar processapat e remover o time antes

Erro na última aposta

Erro ao apostar no último jogo restante dos disponíveis. Ao clicar em apostar, ocorre "Internal server error" e o erro abaixo no log.

2021-09-13T23:18:03.700065+00:00 heroku[router]: at=info method=GET path="/static/img/flag/B%C3%B3snia.png" host=gokopa.herokuapp.com request_id=4b8336f7-70d2-4e57-b17a-920996ed49ac fwd="189.6.37.39" dyno=web.1 connect=0ms service=3ms status=304 bytes=212 protocol=http
2021-09-13T23:18:15.857009+00:00 app[web.1]: idjogo: 71
2021-09-13T23:18:15.861299+00:00 app[web.1]: [2021-09-13 20:18:15,861] ERROR in app: Exception on /editaposta [POST]
2021-09-13T23:18:15.861301+00:00 app[web.1]: Traceback (most recent call last):
2021-09-13T23:18:15.861302+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 2070, in wsgi_app
2021-09-13T23:18:15.861302+00:00 app[web.1]:     response = self.full_dispatch_request()
2021-09-13T23:18:15.861303+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 1515, in full_dispatch_request
2021-09-13T23:18:15.861303+00:00 app[web.1]:     rv = self.handle_user_exception(e)
2021-09-13T23:18:15.861304+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 1513, in full_dispatch_request
2021-09-13T23:18:15.861304+00:00 app[web.1]:     rv = self.dispatch_request()
2021-09-13T23:18:15.861304+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 1499, in dispatch_request
2021-09-13T23:18:15.861305+00:00 app[web.1]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2021-09-13T23:18:15.861306+00:00 app[web.1]:   File "/app/app/routes/bolao.py", line 203, in edit_aposta
2021-09-13T23:18:15.861306+00:00 app[web.1]:     next_bet = list_next_bet.pop(0)
2021-09-13T23:18:15.861307+00:00 app[web.1]: IndexError: pop from empty list
2021-09-13T23:18:15.861995+00:00 app[web.1]: 10.1.95.159 - - [13/Sep/2021:20:18:15 -0300] "POST /editaposta HTTP/1.1" 500 290 "https://gokopa.herokuapp.com/editaposta?idjogo=71" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0"
2021-09-13T23:18:15.789701+00:00 heroku[router]: at=info method=POST path="/editaposta" host=gokopa.herokuapp.com request_id=f78b4ec5-eb46-4e2b-a013-0f77378755cc fwd="189.61.75.127" dyno=web.1 connect=0ms service=8ms status=500 bytes=477 protocol=https

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.