Code Monkey home page Code Monkey logo

foosball-react-nodejs's Introduction

foosball-react-nodejs

Foosball Ranking System written entirely in NodeJS/React

Ingredient used to make this system:

  • NodeJS
  • ExpressJS (for API JSON request/response)
  • React
  • Elo-rank
  • UUID
  • POJOs
  • YARN/NPM

Instructons to setup and run

  1. Download the repo.
  2. Navigate to the project root folder, run npm install or npm i.
  3. To start up API webserice, type yarn start.
  4. To serve front end app, type yarn serve.

Backend API endpoints provided

1. players with get/post verbs.

GET with no request body.

Response Payload: A list of all players is returned.

POST with the following request body.

{
  "name": <player name>
}

Response Payload: A new player is successfully entered in the system.

2. game with post verb.

POST with the following request body.

{
  "winners": [
    <player 1 name>,
    <player 2 name>,
  ],
  "losers": [
    <player 3 name>,
    <player 4 name>,
  ]
}

Response Payload: A new match with paired opponents is created; and their respective opponents' win ratios are calculated and returned.

3. matches with get verbs.

GET with no request body.

Response Payload: A list of all recent played matches is returned.

Front end React UI component provided

An interface to view the JSON payload message when interacting with the API services.

alt text

TODO:

  1. To host it live in Heroku/AWS.
  2. Use a graph API to display matches over time.
  3. Replace the UI json viewer object with more useful actual form input fields.

References

For more information on how players ranking are determined during the games.

https://www.npmjs.com/package/elo-rank

https://en.wikipedia.org/wiki/Elo_rating_system

foosball-react-nodejs's People

Contributors

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