GithubHelp home page GithubHelp logo

bingo's Introduction

Bingo

About

Bingo is a simple app for tracking a simplified corpo-bingo-styled game where players are assigned daily quests for certain work-related phrases. The player marks the number of times the phrase was spoken that day and receives an equivalent in points.

This application provides both a frontend page for displaying each player's phrase and total points, as well as a set of REST endpoints for outside interactions.

Setup

Hook up draw_app.app:app as the WSGI endpoint in your HTTP server of choice.

See https://flask.palletsprojects.com/en/1.1.x/deploying/#deployment for reference.

Front-end

A simple front-end is available at /draw/ and redirected to from base URL (/).

REST API endpoints

$ GET /draw/api/daily

Description

Returns a list of today's assignments.

Example response

{
  "Player1": "Phrase1",
  "Player2": "Phrase2",
  "Player3": "Phrase3"
}

$ GET /draw/api/players/<player:string>/points

Description

Returns the current score of the given player.

Example response

{
  "Player1": 0
}

$ POST /draw/api/players/<player:string>/points

Description

Allows modifying a given player's score. Returns the player's score after the modification.

Arguments

  • "action" (string)
action result
"add" Increments the player's score
"reset" Resets the player's score to zero

Example:

curl -X POST -d '{"action": "add"}' <app>/draw/api/players/Player1/points

Example response

{
  "Player1": 1
}

bingo's People

Contributors

halfinner avatar kajbrz avatar tranzystorekk avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tranzystorekk

bingo's Issues

Inconsistency between config and database

The latest configuration method isn't properly enforced in the database on deploy:

Before the config we had a player named "Śto", now config file defines him as "Sito", and both entries are present in the database.

We need to provide a way of enforcing the names in the configuration, e.g. by scratching the database on deploy if names are different.

Make REST API for points more canonical

@app.route('/draw/rest/addPoints', methods=['POST'])

This version is very non-standard, usually rest APIs are more like:
/draw/rest/points
with GET and POST/PUT for reading and manipulating respectively

Organize deploy

We could assign a special branch for deploys on Heroku.

Right now master is our point of sync, so maybe create a 'deploy' branch, to which we merge/rebase once we have a coherent set of changes/fixes that can be published on the server.

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.