Giter Club home page Giter Club logo

kingpong's Introduction

kingpong

Slack App for keeping score of Ping-Pong in the Office.

This is the result from Flitsmeister Hackathon 2017. Video: https://flitsmeister.github.io/kingpong/

Core contributors:

Free for public use and PR's are welcome!

Installation Guide

  • Copy .env.example to .env
  • Set Slack credentials in .env file.
  • Setup a MySQL database with the following structure and enter credentials in .env
CREATE TABLE `matches` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `player1_id` varchar(255) DEFAULT '',
  `player2_id` varchar(255) DEFAULT '',
  `winner_id` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4;

CREATE TABLE `matches_validation` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `match_id` int(11) NOT NULL,
  `winner_id` varchar(255) DEFAULT NULL,
  `loser_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4;

CREATE TABLE `players` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `playerId` varchar(255) DEFAULT '',
  `playerName` varchar(255) DEFAULT '',
  `score` int(11) NOT NULL DEFAULT '1000',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;

Slack Commands

  • /kingpong register (register current player)
  • /kingpong challenge @playername (challenge player)
  • /kingpong leaderboard (prints the current leaderboard)

Contributing

We use a ESLint file (https://github.com/flitsmeister/fm-eslint) to enforce a code standard, and we try to use most of ES6 features.

  • Fork the repo.
  • Make improvements.
  • Create PR.
  • Wait for code-review and PR approval.
  • Rejoice and repeat :-)

kingpong's People

Contributors

nickmeessen avatar rubenmx avatar scspijker avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

frankkienl

kingpong's Issues

Challenge as a team

Challenge multiple people as teammates with your own teammates.
e.g. /kingpong challenge @ivo @marcel with @nick

ELO rating is calculated by determining an average of the team vs the average of the other team. Players lose or win points determined by that average rating.

Challenge a guest

Maybe we should also rate the guest with an experience factor to determine how many points you can earn.

Challenge timeout

Automatically pussy out when the user doesn't answer within 5 minutes.

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.