flask-monopoly
Based on "How To Structure a Large Flask Application with Flask Blueprints and Flask-SQLAlchemy" at https://www.digitalocean.com/community/tutorials/how-to-structure-a-large-flask-application-with-flask-blueprints-and-flask-sqlalchemy
Based on "Flask SQLAlchemy" at https://github.com/vanHeemstraSystems/flask-sqlalchemy/
Based on "Factory Pattern" at https://github.com/vanHeemstraSystems/factory-pattern
Based on "flask-monopoly" at https://github.com/KrzysztofWelc/flask-monopoly
Based on "Flask CLI Command" at https://testdriven.io/tips/38c1ac63-8d16-4cbc-8488-557b53afa9e5/
Based on "Flask with Sass" at https://github.com/ChristinaVoss/flask-with-sass
Based on "Bundling JavaScript and CSS Files in Flask Using Flask-Assets" at https://www.youtube.com/watch?v=HYO6GNOJMmQ
Based on "pyScss" at https://github.com/Kronuz/pyScss
Run this application as follows:
- Enter
flask_app
directory:$ cd flask_app
- Run
$ pip install -r requirements.txt
- Copy app/sample.env to app/.env:
$ cp app/sample.env app/.env
- Update
app/.env
with your configuration setting. - If non-existent, create a virtual environment inside the
flask_app
directory:$ python3 -m venv .venv
- Start the virtual environment and enter:
$ . .venv/bin/activate
- Run
(.venv) $ ./setup.sh
(macOS or Linux)or(.venv) setup.bat
(Windows) - In case of errors of not finding module Flask-Bycrypt, run
(.venv) $ pip install Flask-Bcrypt
- Create the database:
(.venv) $ flask commands create_db
- Run the flask app:
(.venv) $ flask run
(alternatively$ python main.py
) - Open the web interface as prompted
- Use
CTRL+c
to exit the web server. - Alternatively run the flask command line interface:
(.venv) $ flask shell
- Execute any flask commands: >>>
- Use
exit()
to exit from the command line interface.
Tip: To see all routes, from within the flask_app
directory run $ flask routes
:
$ flask routes
Endpoint Methods Rule
----------------------- --------- --------------------------
auth.login GET, POST /auth/login
auth.logout GET /auth/logout
auth.profile GET /auth/profile/<user_id>
auth.register GET, POST /auth/register
game.field_info GET /field_info/<field_id>
game.guest_waiting_room GET, POST /guest_waiting_room/<code>
game.home GET /
game.hot_seats GET, POST /hot_seats/<code>
game.hot_seats GET /hot_seats
game.init_pvp GET /init_pvp
game.join_game GET, POST /join_game
game.menu GET /menu
game.play_pvp GET, POST /play_pvp/<code>
game.vs_ai GET, POST /vs_ai/<code>
game.vs_ai GET /vs_ai
game.waiting_room GET, POST /waiting_room/<code>
static GET /static/<path:filename>
Tip: To see all custom commands, from within flask_app
directory run $ flask commands --help
from a terminal.
Warning: Make sure to use pyScss
version 1.3.7 (not 1.4.0) as it would re-introduce a bug ("global flags not at the start of the expression at position 1"). Update: use libsass instead of pyScss
.
See README.md
See README.md
See README.md
See README.md