Giter Site home page Giter Site logo

riichi / kcc3 Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 361 KB

Web application that tracks Riichi Mahjong players achievements (chombos) and grants badges

Home Page: https://fanpai.chombo.club

License: MIT License

Python 81.16% HTML 16.37% CSS 0.89% Dockerfile 1.10% Shell 0.47%
badge-server mahjong django riichi chombo

kcc3's Introduction

kcc3

Docker Images Build Status License

KCC3 is a simple badge server developed for Kraków Chombo Club. It puts the focus on providing simple interface, automate as much as possible and provide features especially useful for Rīchi Mahjong players.

Features

  • Player database (tied with their USMA and Discord IDs)
  • Static (manually-assigned) badges
  • Dynamic badges that are updated automatically by querying given remote server that returns list of badge bearers
  • Chombo event database
  • Lightweight web user interface
  • Easy to use admin panel
  • RESTful API to get the data stored

Quickstart

pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Running the workers

Make sure you have RabbitMQ installed.

celery -A kcc3 worker --beat --scheduler django --loglevel=info

pre-commit

We encourage contributors to use predefined pre-commit hooks — to install them in your local repo, make sure you have pre-commit installed and run:

pre-commit install

Creating own badge clients

Any third party can create their own dynamic badge by setting up a so called badge client. Badge client is a web service that gets queried once per given interval and returns a list of players that should be awarded the badge. The badge client can make use of KCC3's RESTful API to get all the data needed for granting the badge.

The communication uses conveniently defined models for data interchange (with accompanying Serializer classes) as well as generated token for verifying message authentication. To implement such service, one can either use a small library inside /badgeupdater/client/ (as well as common files inside /badgeupdater/), or just implement the protocol (which is as easy as parsing/serializing simple JSONs and comparing tokens).

First-parties can use convenient class called LocalBadgeClient and access the database directly, without the API as a middleware.

Local badge clients

There are some predefined local badge clients that can be used for creating some specific dynamic badges easily.

/badge-clients/badges/test/

Simple test client that grants a badge to all existing Players.

/badge-clients/chombos/chombos/

Grants the badge to each player that has ever done a chombo.

kcc3's People

Contributors

dependabot[bot] avatar iipin avatar m4tx avatar seqre avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.