wa-robotics / wa-robotics-scout

WA Robotics Scout was a scouting application used by the WA Robotics VEX teams during the Nothing But Net and Starstruck seasons
MIT License
2 stars 0 forks source link

Back-end code to send statistics for a given team to the front-end (including individual team search) #8

Open evan10s opened 7 years ago

evan10s commented 7 years ago

This consists of API support to get the scouting information for a team or match, and then return the data as a list of field display names and values. The reason for the specific return format is that this will allow for a simple data parser* to create the tables to show this data.

*The only exception is the results of the scouting form question about where a team shoots objects. This requires special processing to generate a heatmap on an image; luckily, there's a library for this: https://github.com/pa7/heatmap.js

evan10s commented 7 years ago

Scouting form submissions can be fetched from Firebase using a flow similar to this:

  1. Client makes AJAX request to server and includes API query and Firebase token
  2. Server validates Firebase token and decodes it to get their user ID a. If token does not validate, no private scouting information gets sent.
  3. Server verifies that the user's ID is listed as a user on the organization they are trying to get scouting information from. Exception: there's an organization sharing scouting data (#34) and an organization with the same tournament in it has this user listed as a member and is also sharing scouting data
  4. If step 3 passes, process the scouting data and send back a neat object of averaged/consolidated data