Web application for playing trivia games using Flask, SQLite, Bootstrap and JavaScript. Users are able to add new questions or use the ones provided by the OpenTriviaDatabase. The server has moderation, so submited questions are first reviewed by an admin. This project is still under development and many features are not yet implemented.
This method is recommended if you want to edit the code.
1. Clone the GitHub repository (git is required)
$ git clone https://github.com/muyrety/Smarter.git
2. Create a Python virtual environment (Python is required)
$ cd Smarter
$ python -m venv .venv
$ . .venv/bin/activate
> cd Smarter
> python -m venv .venv
> .venv\Scripts\activate
$ pip install -e .
$ flask --app smarter init-db
$ flask --app smarter add-admin
or
$ flask --app smarter add-admin --username YOUR_USERNAME --password YOUR_PASSWORD
$ flask --app smarter run
or
$ python -m smarter
This method is recommended if you want to host (deploy) the app.
1. Download the wheel file from GitHub releases
$ wget https://github.com/muyrety/Smarter/releases/download/pre-release/smarter-VERSION-py3-none-any.whl
or just navigate to the releases page and download through a browser.
2. Navigate to the directory you downloaded the file to and create a Python virtual environment (Python is required)
$ python -m venv .venv
$ . .venv/bin/activate
> python -m venv .venv
> .venv\Scripts\activate
$ pip install smarter-VERSION-py3-none-any.whl
$ flask --app smarter init-db
5. Generate and set the SECRET_KEY in .venv/var/smarter-instance/config.py to securely sign the session cookies
$ python -c 'import secrets; print(secrets.token_hex())'
YOUR_GENERATED_VALUE
# .venv/var/smarter-instance/config.py
SECRET_KEY = YOUR_GENERATED_VALUE
$ flask --app smarter add-admin
or
$ flask --app smarter add-admin --username YOUR_USERNAME --password YOUR_PASSWORD
$ flask --app smarter run
or
$ python -m smarter