Giter VIP home page Giter VIP logo

foos's Introduction

Requirements

python >= 3.6 pip >= 18.x virtualenv >= 16.0.0

brew install python3
brew install pip3
brew install virtualenv

Install Steps

To setup virtual environment, from within project directory:

virtualenv virt
source virt/bin/activate

To deactivate virtual env any time:

deactivate

Install dependencies with virtual environment

pip install Flask flask_sqlalchemy flask_marshmallow marshmallow-sqlalchemy trueskill

Importing games locally

To create the new database structure and import the games recorded from the score cards:

FLASK_ENV=dev python import.py --reset

Note: If you don't specify --reset, the db will not be reset and all games in the script will be added

To get the teams rankings in nice text formatted output:

FLASK_ENV=dev python rankings.py

Running Locally

FLASK_ENV=dev python application.py

You can then access in browser or postman via endpoints:

http://localhost:5000/team

http://localhost:5000/player

http://localhost:5000/game

Deployment to AWS

To be able to deploy to AWS Elastic Beanstalk, you need to install EB CLI described here: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html

pip install awsebcli --upgrade --user

You will then need to initialise eb deployment:

eb init

Then for any changes to app we simply run

eb deploy

To initially import all the games for the first time, ssh into aws eb env:

eb ssh
sudo su
cd /opt/python/current/app
source /opt/python/run/venv/bin/activate

python import.py --reset

And to open base url in browser:

eb open

Currently base url on EB env is:

http://foos.test.kounta.com

References

foos's People

Contributors

brendan-roche avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.