Coder Social home page Coder Social logo

firstlegoleague / tournament Goto Github PK

View Code? Open in Web Editor NEW
2.0 7.0 7.0 5.34 MB

This module is used as an API that handles all the tournament specific data

License: GNU General Public License v3.0

JavaScript 37.99% HTML 14.07% TypeScript 47.22% CSS 0.72%

tournament's Introduction

npm codecov Build status GitHub

Tournament Module

This module is used as an API that handles all the tournament specific data. Data like teams, matches, table names and more.

The API

The API is REST based, The available models are detailed below.

  • team
{
    number: number,
    name: string,
    affiliation: string, // optional
    cityState: string, // optional
    country: string, // optional
    coach1: string, // optional
    coach2: string, // optional
    judgingGroup: number // optional
    pitNumber: number, // optional
    pitLocation: number, // optional
    translationNeeded: boolean // optional
}
  • match
{
  matchId: number,
  startTime: date,
  endTime: date,
  stage: string,
  matchTeams: [
    {
      teamNumber: number,
      tableId: number
    }
  ]
}
  • table
{
  tableId: number,
  tableName: string
}

And this are the available endpoints for those models:

  • GET /model/all - return all the objects
  • GET /model/:id - return the object with that id
  • POST /model - add a new object (as described later)
  • PUT /model/:id - edit the object with that id
  • DELETE /model/:id - delete the object with that id

There are 2 more APIs available, the Images API and the Tournament Settings API

The Images API

Used to retrieve images for the Display. Please be noted that the images are retrieved and sent with Base64 encoding.

The endpoint is /image and the available options are:

  • GET /all - returns an array of all the images.
  • GET /:imageName - returns the image with the specified name The response structure:
{
  imageName: image-name,
  image: base64 encoding image
}
  • POST / - Used to add a new image. Body with that structure:
{
  imageName: image-name,
  image:
}
  • DELETE /:imageName - Used to delete an image

The Tournament Settings API

There is no option to add a setting with this api. This API is for reading and updating the settings.

  • GET /settings/:settingName - Returns the setting with settingName
  • PUT /settings/:settingName - Updates the setting with settingName, The body of the request:

  {
     setting: settingContent
  }

Be aware that reading the data is available for all, but updating/deleting/inserting only for certain users.


Development environment

This module uses the Yarn package manager. To run the module in a development environment

  • type yarn to install all the dependencies of the project (module).
  • type yarn start to start the server. The server listens on port 3000.

Two points to note:

  1. MongoDB must be available on your system PATH i.e. PATH must include the path to mongod.exe. MongoDb is started by yarn start so it must not be running already.
  2. The mhub server is started by yarn start. It too must not be already running (which will happen if an installed version of the TMS Scoring Software is running).

Publishing to NPM

When you are ready to publish to npm

  • run the command yarn publish from the repo root directory.
  • You will be asked to update the version number.
  • Following that the script will run the build ng build --prod and publish the artifacts to @first-lego-league/tournament.

Notes:

  • You must be a member of the npm first-lego-league organization to publish the package.
  • Verify version in npm [@first-lego-league/tournament] after the publish has completed (https://www.npmjs.com/package/@first-lego-league/tournament)
  • Remember to push package.xml (containing the updated version).

Adding new version to the launcher

Please see the launcher README for instructions on how to include your update in the launcher build.

Contributing

To contribute to this repository, please make a fork, make your changes and submit a pull request.

This way of work allows us to maintain proper code quality, which is important when working with a large amount of people on the same project.

The best way to work on a feature or a bug is to follow these steps:

  • fork the repository to your own github account
  • if already forked, make sure your fork is up to date with the base repo
  • create a new branch for your feature or bugfix
  • work
  • test
  • create a pull request to merge your development branch into a branch in the base repo
  • we will review your pull request, when ok, we will merge it into master

tournament's People

Contributors

taltaub22 avatar idanstark42 avatar yonatangideoni avatar 2roy999 avatar alanggreen avatar itamaroryan avatar itamargreen avatar dependabot[bot] avatar

Stargazers

 avatar Boivin avatar

Watchers

James Cloos avatar Brian Ivie avatar  avatar Yosi Karl avatar  avatar  avatar  avatar

tournament's Issues

Sound effect delay when timer hits 0

It seemed to us during the past 2 weeks of tournament use that the clock has to hit "-1" for the ending buzzer to sound. Either that our our PC is super slow at playing sounds...we would have expected the buzzer to sound as soon as 0:00 is displayed, but it appeared to us to be about 1 second after 0:00... ?? anyone else see this?

Add readme

Must include:

  1. What it is
  2. How it works
  3. API
  4. How to contribute

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.