A bunch of us over at italygames felt the necessity to create a tool that would let us find other gamers to play with. Play is born from this idea and we hope it will help bring gamers from reddit closer together.
Play is completely open source and on its early stages of development so we would love if you could help it grow by contributing. Play is being developed using Flask and Bootstrap. We also would like to thank all the awesome people that developed the open source libraries we are currently using: Flask-Login, Flask-Migrate, Flask-SQLAlchemy, Flask-Script, Flask-Testing, Flask-WTF, coverage, gunicorn, rauth.
- Python, virtualenv is recommended
- MySQL and/or SQLite
- Register a Reddit web app here
Please note that in order to use another DB you would need to check for SQLAlchemy support and install dependencies accordingly.
Get a copy of the source code
$ git clone https://github.com/acifani/italygames-play.git
$ cd italygames-play $ virtualenv venv $ source venv/bin/activate (venv)$ pip install -r requirements.txt
You need to setup the following environment variables (
export VARIABLE=VALUE if on Linux)
FLASK_CONFIG: Set to either
production based on your environment. You can add more config sets in
FLASK_APP: File that contains the app (not the app factory), in our case
SECRET_KEY: Secret key needed by Flask to handle Sessions encryption. Check Flask Sessions docs.
DB_URI: Database URLs, if not set defaults to SQLite. You can modify defaults in
OAUTH_REDDIT_SECRET: The reddit app ID and Secret key, you can get those here after you register your app.
Database first time setup
(venv)$ python manage.py create_db (venv)$ python manage.py db stamp head
(venv)$ python manage.py runserver
Flask built-in development server: do NOT use for production as it is not build to manage more than one request at the time.
(venv)$ python manage.py gunicorn
Gunicorn WSGI HTTP server.
--workersNumber of worker threads to use. Gunicorn recommends to set this to
(2 x $num_cores) + 1.
--portPort number. Also supports Unix sockets.
(venv)$ python manage.py test
Run the test with
coveragereport and generates HTML version inside
You can use
python manage.py db to access all the Flask-Migrate CLI commands.
Usually when you make a Model change you want to run
python manage.py db migrate
to generate migration scripts inside
migrations/versions. Check those and if OK
python manage.py db upgrade to execute the changes on the database.
More info on how to build and deploy with Docker and docker-compose will be added Soon™.
If you have any question or feedback please do get in touch with us on:
The content of this project itself is licensed under the Creative Commons Attribution 3.0 license, and the underlying source code used to format and display that content is licensed under the MIT License.