Code Monkey home page Code Monkey logo

questmaster's Introduction

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

questmaster's People

Contributors

notsag avatar

Watchers

 avatar

Forkers

tissema ceddoc

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.