GithubHelp home page GithubHelp logo

clates / penny-dreadful-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pennydreadfulmtg/penny-dreadful-tools

0.0 0.0 0.0 47.22 MB

A suite of tools for the Penny Dreadful MTGO community

Home Page: https://pennydreadfulmagic.com

License: GNU General Public License v3.0

Python 84.04% Shell 0.05% HTML 3.94% JavaScript 4.66% PLpgSQL 0.09% Mako 0.03% Dockerfile 0.07% Mustache 7.11% Procfile 0.01%

penny-dreadful-tools's Introduction

Penny Dreadful Tools

Repository for the tools used by the Penny Dreadful Community.

View individual subdirectories for details

Build Status Uptime Robot status

Modules

analysis is for Magic Online game log analysis.

decksite is the code for pennydreadfulmagic.com.

discordbot is the Discord chatbot.

github_tools are some GitHub integration utillities.

logsite is the code for logs.pennydreadfulmagic.com.

logsite_migrations are alembic database migrations for logsite.

magic is for information about Magic โ€“ cards, decklists, card images, legality, etc.

maintenance is for useful scripts, usually run via cron.

modo_bugs is for integration with https://github.com/PennyDreadfulMTG/modo-bugs/issues.

price_grabber builds a database of card prices.

pylint_monolith is for our custom extensions to pylint.

rotation_script is for the script that handles Penny Dreadful rotation (card legality changes each season).

shared contains a bunch of general purpose helper classes. Things that could be used in any project.

shared_web contains a bunch of web-specific helper classes. It also contains our React code for "live" data tables.

Contributing

Contributions are very welcome. Please join the Discord at https://pennydreadfulmagic.com/discord/ and feel free to ask questions in #code.

Development Environment Setup

If you plan on running things outside of the containers (eg: dev.py or logsite):

Configuring Environment

  • Add a bot at https://discordapp.com/developers/applications/me
  • Add a bot user for the bot
  • Add the bot to your server with https://discordapp.com/oauth2/authorize?client_id=<your client id here>&scope=bot
  • Click to reveal the token (not secret) on https://discordapp.com/developers/applications/me
  • Copy .env.example to .env and alter the value for "token" to this value
  • Do the same for the discord client_id and client_secret
  • Optionally take a look at shared/configuration.py and enter any required non-default information into .env
  • You will want to investigate the various targets in dev.py that acts as a Makefile. Some of these utilities use GitHub's commandline git-enchancer, hub: https://github.com/github/hub

Manual Development Environment Setup (Non-docker instructions)

  • Install MariaDB 10.0+
  • Install python 3.10
  • Install pipenv
  • Install npm
  • git clone https://github.com/PennyDreadfulMTG/Penny-Dreadful-Tools.git
  • cd Penny-Dreadful-Tools
  • pipenv install
  • pipenv run python build.py
  • Using the values from your .env issue the following commands in MySQL (you don't need to create the databases):
    • CREATE USER '<mysql_user>'@'<mysql_host>' IDENTIFIED BY '<mysql_passwd>';
    • GRANT ALL ON <decksite_database>.* TO '<mysql_user>'@'<mysql_host>'; GRANT ALL ON <decksite_test_database>.* TO '<mysql_user>'@'<mysql_host>';
    • GRANT ALL ON <prices_database>.* TO '<mysql_user>'@'<mysql_host>';
    • GRANT ALL ON <magic_database>.* TO '<mysql_user>'@'<mysql_host>';
    • GRANT ALL ON <logsite_database>.* TO '<mysql_user>'@'<mysql_host>';
  • Download a copy of the production decksite database (with personal information stripped):
    • mysql -u <mysql_user> -p<mysql_passwd> -e "CREATE DATABASE <decksite_database>"
    • curl https://pennydreadfulmagic.com/static/dev-db.sql.gz >/tmp/dev-db.sql.gz
    • gunzip /tmp/dev-db.sql.gz
    • mysql -u <mysql_user> -p<mysql_passwd> <decksite_database> </tmp/dev-db.sql
    • mysql -u <mysql_user> -p<mysql_passwd> -e "CREATE DATABASE <decksite_test_database>"
  • Some very minor parts of the bot (the "modofail" command) use libopus and ffmpeg which are not in pip and must be installed in a your-OS-specific way separately. Very optional.

Running Decksite (pennydreadfulmagic.com)

Running Logsite (logs.pennydreadfulmagic.com)

Running Discordbot

  • pipenv run python run.py discordbot
  • Visit your Discord server.

Running the tests

There are various levels of granularity but in general use you want:

  • pipenv run python dev.py test # Runs the unit tests, type checking, lint.

Check the dev.py source code for the full set of options including unit, types, lint (covered by test above) as well as functional (integration tests), perf (performance tests). release will take you all the way from your committed change to a PR via the tests (needs GitHub's commandline gh/hub installed).

Working on React components

  • Run logsite
  • pipenv run python dev.py watch # Builds bundle.js after every file change.

penny-dreadful-tools's People

Contributors

bakert avatar silasary avatar dependabot[bot] avatar vorpal-buildbot avatar mergify[bot] avatar requires avatar dependabot-preview[bot] avatar pyup-bot avatar adambiltcliffe avatar bors[bot] avatar jgabrielygalan avatar tsutton avatar wizzerinus avatar kzcheng avatar codyjasonbennett avatar pseudodude avatar aurous avatar binaryswordsman avatar mmrsad avatar lokrium avatar volvary avatar eightbitellie avatar mvousden avatar github-actions[bot] avatar kalioc avatar md822 avatar artillect avatar santirivera92 avatar

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.