Skip to content

The Club JDR booking app for roleplaying sessions.

License

Notifications You must be signed in to change notification settings

Club-JDR/questmaster

Repository files navigation

QuestMaster

CI Quality Gate Status License: MIT Python 3.11 Code style: black

The Club JDR booking app for roleplaying sessions.

This app is meant for GMs to create new Games with all the details (name, type, number of players, date and time of the sessions etc..) and for players to be able to register for the games. It interacts with the Discord server to automatically create roles and channels for the games.

Build, run and test

Create a .env to set the following variables:

FLASK_AUTH_SECRET=""
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
DISCORD_BOT_TOKEN=""
DISCORD_REDIRECT_URI="http://localhost:8000/callback"
DISCORD_GUILD_NAME=""
POSTGRES_USER="club"
POSTGRES_PASSWORD=""
POSTGRES_DB="questmaster"
POSTGRES_HOST="db"
REDIS_HOST="redis"
UNITTEST_CHANNEL_ID=""
POSTS_CHANNEL_ID=""
CATEGORY_OS_CHANNEL_ID=""
CATEGORY_LONG_CHANNEL_ID=""
DISCORD_GUILD_ID=""
DISCORD_GM_ROLE_ID=""
DISCORD_ADMIN_ROLE_ID=""
FLASK_APP="website"
USER_ID_LIST="{ \"gm1\": \"<id of user with GM role>\", \"gm2\": \"<id of other user with GM role>\", \"notgm\": \"<id of user without GM role>\", \"admin\": \"<id of user with Admin role>\"}"

Using docker compose

Start the complete stack:

docker compose up -d --build

To init the database and run the migrations:

docker exec -it questmaster-app-1 bash -c "flask db init && flask db migrate && flask db upgrade"

To run the tests:

docker compose run app-test python -m pytest tests/ website

Locally

Edit the .env to change the POSTGRES_HOST value to localhost. Run at least the database and eventually pgadmin:

docker compose down && docker compose up -d --build db pgadmin

To init the database and run the migrations:

flask db init && flask db migrate && flask db upgrade

Then, you can run the app:

flask run -p 8000
# Or in debug if you don't want to restart it at every code change
flask --app website --debug run -p 8000

To run the tests:

python -m pytest tests/ website

Flask shell

You can connect to a shell (to test your models, interact with the database and so on) by simply running:

# if using docker compose
docker compose run app flask shell
# if running locally
flask shell

About

The Club JDR booking app for roleplaying sessions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published