Giter VIP home page Giter VIP logo

firstteam102 / scoutradioz Goto Github PK

View Code? Open in Web Editor NEW
25.0 6.0 8.0 63.78 MB

Scoutradioz, a multi-team FRC scouting app developed by The Gearheads. Designed for and running on Amazon Web Services.

Home Page: https://scoutradioz.com

License: Other

JavaScript 21.75% CSS 4.30% Shell 0.05% Pug 15.49% Less 6.16% TypeScript 44.75% Dockerfile 0.09% HTML 0.04% Svelte 7.08% SCSS 0.28%
nodejs first-robotics-competition aws-lambda frc frc-scouting

scoutradioz's Introduction

Scoutradioz logo

Scoutradioz is a multi-year FRC scouting app developed by The Gearheads which runs on Amazon Web Services (AWS).

Initially created in 2018, Scoutradioz has continually evolved as a platform. Here is a list of some of the features Scoutradioz offers:

  • Modular and configurable pit & match scouting surveys, so your organization can pick exactly what info you want to record and show
  • Automatic, individualized pit & match scouting assignments
  • Advanced reports and metrics
  • Event management tools such as auditing match assignments, swapping scouters in and out, and managing a list of members
  • And of course, it's completely free!

Please visit the wiki for documentation on how to use the app.

App structure

We use AWS Lambda, Express, MongoDB, and Node (LEMoN); as well as Pug, Atlas, S3, The Blue Alliance API, and many other libraries and packages.

Primary

This is the primary Lambda function that serves most user requests. The https://scoutradioz.com website runs on the Primary function.

Upload

This Lambda function handles two things:

  • Photo uploads to AWS S3
  • Dynamic generation of header images for push notifications, notifying scouters of an upcoming match assignment

(The latter was introduced after upload.scoutradioz.com was created, but both routes require image processing so we combined the two.)

Webhook

Scoutradioz is subscribed to The Blue Alliance's Firehose, which provides the site with up-to-date information on every supported match and event. This Lambda function handles data provided by the Firehose, and sends push notifications to scouters who are assigned to an upcoming match & have notifications enabled.

Helper packages

NOTE: Originally, the helper packages were published on NPM with the prefix @firstteam102 - https://www.npmjs.com/org/firstteam102 - but to simplify the process of updating the code, they are no longer being published to NPM and instead are being linked internally. For example, in primary's package.json, "@firstteam102/scoutradioz-utilities": "1.0.2" has been changed to "scoutradioz-utilities": "../scoutradioz-utilities/". Most of the @firstteam102 packages on NPM have been deprecated.

scoutradioz-utilities

A package that contains our database manager / caching wrapper.

scoutradioz-helpers

A package that contains helper functions needed across multiple packages, such as parsing match data, calculating metrics, and listing team images.

scoutradioz-http-errors

A small package that exposes a small handful of HTTP errors for use inside Express routes. We created this one instead of alternatives because it has no dependencies and only contains what we need.

scoutradioz-eslint

ESLint plugin, to assist development, which enforces a title being provided any time a page is rendered.

Localization

Weblate

We're translating Scoutradioz so FIRST teams and their members, friends, and family from all over the globe can use it in their preferred languages. Translation contributions can be submitted using Weblate.

scoutradioz's People

Contributors

aleksej0r avatar alexkempen avatar ardaglash avatar caburum avatar comradekingu avatar dependabot[bot] avatar fnogcps avatar gearheads102 avatar jl102 avatar joshua-anderson1 avatar mmarchjr avatar rmaizel avatar tamaki-kaworu avatar vichik123 avatar weblate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

scoutradioz's Issues

Team Admins cannot access the Update Match(es) methods

We plan to eventually make the match-info syncing process with TBA fully automatic, but it's not quite there yet. In the interim, we need to let team admins handle match data syncing at matches they are attending. Reported by Leo on Discord

Scouts offline capabilities - download assignments, cache results, bulk upload

Enable scouts to:

  1. Enable scouts to save, or update, their schedule of match scouting assignments to local storage
  2. Enable the match scouting form to load from an assignment in local storage
  3. Enable the match scouting form to save the form results to local storage
  4. Enable the scout to 'bulk upload' all their saved match scouting form results
  5. to 8. {repeat 1-4 but for pit scouting}

Enhance offline scout lead functionality with QR codes

Enable scouting lead to be able to:

  1. Enable the scouting lead to save, or update, all the match scouting assignments to local storage
  2. Enable the scouting lead to generate a QR code which represents the scouting assignments for a selected scout
  3. Enable the scouting lead to generate a QR code which represents a single one-off match scouting assignment
  4. Enable the scouting lead to read a scout's QR code from a match scouting form and save the data to local storage
  5. Enable the scouting lead to 'bulk upload' all their locally stored match scouting form results
  6. to 10. Repeat for pit scouting

UI for teams to design/update their "pit" scouting form/schema

Implement user interface to allow team admins to design/update their “pit” scouting form/schema

  1. Users can load their current pit scouting form {or start with a default/blank form} and can then add, update, rearrange, or remove form elements
  2. Removing a form element when data exists for the current season should show a warning pop-up and require password-based confirmation that that element really should be removed
  3. Users can save the pit scouting form

Allow swapping of users while offline

Use case: Single device that's shared among multiple users

Original report:

I've noticed that in voyager, ... we are unable to consistently swap users on a tablet when fully offline. Even after getting everything successfully synced.
We are able to function without by putting the scouter name in comments but i thought it might be worth acknowledging

The reason it's requiring you to be online to pick a user is because when we add the ability to log in as a scouting lead, you will need to authenticate with your password. I think we'll have to split that process out, i.e. "Log in as scouting lead" or something, and then keep the "pick user" process entirely local, so that once you're authorized to an org, you can pick your own user without needing to be online.

Add a way for admins to log in to other orgs without having a user

Idea:

  • During org creation, automatically create a hidden "Scoutradioz Admin" (or "scoutradioz_admin") user, similar to "default_user".
  • In the admin index page (or the orgs management page), add a button to switch to that Scoutradioz Admin user in any org.
  • Requires a password input any time you wish to do it

This code will have to be pretty bulletproof, so before merging, I'll ask the other devs to review it.

Error: Cannot read properties of undefined (reading 'name') To help us fix this error, please:

https://www.scoutradioz.com/frc386/manage/

TypeError: Cannot read properties of undefined (reading 'name')
at eval (eval at wrap (/var/task/node_modules/pug-runtime/wrap.js:6:10), :177:63)
at eval (eval at wrap (/var/task/node_modules/pug-runtime/wrap.js:6:10), :192:4)
at template (eval at wrap (/var/task/node_modules/pug-runtime/wrap.js:6:10), :299:7)
at exports.renderFile (/var/task/node_modules/pug/lib/index.js:454:38)
at exports.renderFile (/var/task/node_modules/pug/lib/index.js:444:21)
at exports.__express [as engine] (/var/task/node_modules/pug/lib/index.js:493:11)
at View.render (/var/task/node_modules/express/lib/view.js:135:8)
at tryRender (/var/task/node_modules/express/lib/application.js:657:10)
at Function.render (/var/task/node_modules/express/lib/application.js:609:3)
at ServerResponse.render (/var/task/node_modules/express/lib/response.js:1039:7)

Did we miss a step in setting up team stuff?

Thanks,
Will

Change AVG calculations to exponential moving averages

Example pipeline from Compass:

[
{
'$match': {
'team_key': {
'$in': [
'frc102', 'frc11', 'frc223'
]
},
'org_key': 'frc102',
'event_key': '2022njfla',
'data': {
'$ne': null
}
}
}, {
'$setWindowFields': {
'partitionBy': '$team_key',
'sortBy': {
'time': 1
},
'output': {
'expMovingAvgForTeam': {
'$expMovingAvg': {
'input': '$data.contributedPoints',
'alpha': 0.4
}
}
}
}
}, {
'$group': {
'_id': '$team_key',
'contributedPointsEMA': {
'$last': '$expMovingAvgForTeam'
},
'contributedPointsAVG': {
'$avg': '$data.contributedPoints'
},
'contributedPointsSTD': {
'$stdDevSamp': '$data.contributedPoints'
},
'contributedPointsCNT': {
'$sum': 1
}
}
}
]

Add link to QR code image to hamburger menu

Add link to QR code image to hamburger menu

Ideally, dynamically generate so it can refer to the tenant the user is looking at (or if on the “Choose an organization” page, QR code will be ‘general’ SR link)

Custom ad-hoc / shareable reports

Custom ad-hoc / shareable reports; essentially featherweight Tableau, picking metrics for bar charts, line charts, by time or by grouping, bubble charts, etc.

Rename "Scouting Pairs" to "Scouting Groups" or "Scouting Teams"

To help prevent confusion over the intended purpose and usage of the "Scouting Pairs" functionality in the app, it would be better if a more descriptive term like "Scouting Groups" or "Scouting Teams" was used instead.

Of these two choices, I personally prefer "Scouting Teams", as this helps implies the co-operative nature of each group, but I don't feel strongly either way.

Additional discussion:
https://discord.com/channels/936402730317148170/936418650414530590/1077366905213562995

Remove "order" From JSON Schema

Since JSON arrays are ordered, the "order" key-value pair in the JSON schema is redundant and can be injected at runtime.

This could be implemented by modifying the parsed JSON object-array directly prior to adding it to the database.

Relevant codebase sections(?):
https://github.com/FIRSTTeam102/ScoringApp-Serverless/blob/master/primary/src/routes/manage/orgconfig.ts#L167
Pug view:
https://github.com/FIRSTTeam102/ScoringApp-Serverless/blob/master/primary/views/manage/config/editform.pug#L46

Enable i18n (internationalization) including supporting Hebrew RTL

Enable i18n (internationalization) ~ user-selectable languages including Hebrew RTL

  1. Implement an I18N library/etc. to pick up browser language settings and (if a translation is available) show text in that local language context
  2. Convert every textual label on every page/etc. into a translation lookup
  3. Convert instances of dynamic translatable text (e.g., "Red" vs. "Blue") into dynamic translation lookups
  4. Update non-trivial 'left-to-right to right-to-left' designs (all done except for upcoming & finished matches?)
  5. Write up how volunteers will go about creating new local language files

Rework pit/match scouting assignment methods

Specific design specs to be brainstormed, but the current "multi-step" process was a quick hack and has long past outlived its welcome

See also issue regarding updating pit scouting when team list is updated after assignments are made

Open source license

I noticed that this codebase isn't licensed, but is a public repository. I'm not a lawyer, but as far as I can tell this prevents the modification or reuse of this codebase, because unlicensed code is fully protected under copyright law. This also potentially prevents 3rd parties from contributing, because of the complications that come with each contributor having copyright on their own contributions. choosealicense is a good resource to find an open source license, if you choose to do so.

(More information on the restrictions around unlicensed code)

Redirects no longer work consistently

After merging #103, ? (query) parameters do not consistently work in redirects.

To reproduce:

  1. Go to a teamintel page (/reports/teamintel?team_key=102)
  2. Navigate to Configure Report Columns
  3. Click Save column selections
  4. You will receive a 404 page instead of navigating back to teamintel, because the ? in the url is now encoded

Pre-game alliance selection by calculating odds of hypothetical alliance match-ups

Pre-game alliance selection by

  1. Calculating odds of hypothetical alliance match-ups;
  2. Enable ‘defense’ estimation in a hypothetical match-up by assigning bot X against bot Y; X will spend N% of time defending (the rest scoring), and their defense will reduce Y scoring by M% (“N” and “M” being user-definable, e.g. sliders)

Allow users to browse other events that their org has gone to

There should be some switcher that lets users pick which event to view.

Don't know the best way to implement this in terms of UI, but there should be some indicator (maybe on the header?) that they're viewing a separate event from their org and allow them to switch back to the current event.

Enhance offline scout data transfer with QR codes

Enable scouts to:

  1. Enable a scout to read a QR code of multiple scouting assignments and save the assignments to local storage
  2. Enable a scout to read a QR code of a single assignment and set up scouting that robot/match
  3. Enable a scout to create a QR code representing the data from one of the match scouting forms in their local storage
  4. Also - Be able to create a "one-off" QR code to 'transfer' an assignment to another scout

Store a record of when data is pulled from TBA to (1) make use of ETag and reduce bandwidth, and (2) automatically sync data as-needed

This would allow #148 to be automatically handled by auto-pulling the list of teams from an event if, for example, the match schedule was updated more recently than when the team list was updated, and the team list has not been pulled in, for example, >6 hours. TBA supports ETag/If-None-Match headers (https://www.thebluealliance.com/apidocs) so if we store the etag and time of each of our TBA API calls, we'd be able to reduce the bandwidth requirements on TBA's servers from all of our syncing, and we'd be able to do some more "Let's automagically fix this data issue in the background" wizardry, without having to worry about the edge case where a recalculation/data-re-pull doesn't actually fix the issue, since we'd only re attempt that fix once in a while.

Port the backend site code to TypeScript

Using TypeScript for back-end code will help with managing data like database structures.

Plan:

  1. Investigate the way that people normally use TypeScript with Express
  2. Experiment with a much smaller function, like Webhook, and with scoutradioz-utilities.
  3. Create type definitions for our database structures, possibly in a new NPM package?
  4. Port scoutradioz-helpers, scoutradioz-http-errors, scoutradioz-utilities, webhook, and upload to TypeScript
  5. After we're used to that process, we can then begin to port primary to TS. (which will be the biggest chore)

Enable cross-organization shared data schemas

Add in non-org-specific “core” data schema definitions, which teams can elect to use as the base for their own data collection
Allow orgs to extend “core” data schemas in their org-specific schemas

UI for teams to design/update "match" scouting form/schema

Implement user interface to allow team admins to design/update their “match” scouting form/schema

  1. Users can load their current match scouting form {or start with a default/blank form} and can then add, update, rearrange, or remove form elements
  2. Removing a form element when data exists for the current season should show a warning pop-up and require password-based confirmation that that element really should be removed
  3. Users can save the match scouting form

Layout.forEach

image

image

Code:


{
  "heading": "Charged Up - 2023 (Pit Scouting)",
  "logo": "logo.png",
  "skipTeamSelection": true,
  "pages": [
    {
      "name": "Team",
      "widgets": [
        {
          "name": "Team Number",
          "type": "number"
        },
        {
          "name": "Drive Coach",
          "type": "text"
        },
        {
          "name": "Driver Names",
          "type": "text"
        }
      ]
    },
    {
      "name": "Robot",
      "widgets": [
        {
          "name": "Height",
          "type": "number"
        },
        {
          "name": "Length",
          "type": "number"
        },
        {
          "name": "Width",
          "type": "number"
        },
        {
          "name": "Wheel-Bumper Distance",
          "type": "number"
        },
        {
          "name": "Weight",
          "type": "number"
        },
        {
          "name": "Drivetrain",
          "type": "dropdown",
          "options": [
            "West Coast",
            "Swerve",
            "Butterfly",
            "Mecanum",
            "Other"
          ]
        },
        {
          "name": "Swerve Motor Type",
          "type": "dropdown",
          "options": [
            "Neo",
            "Falcon",
            "Cim"
          ]
        },
        {
          "name": "Swerve Type",
          "type": "dropdown",
          "options": [
            "No swerve",
            "L1",
            "L2",
            "L3",
            "L4",
            "Neo",
            "Falcon",
            "Custom"
          ]
        },
        {
          "name": "Has Driver Camera",
          "type": "checkbox"
        }
      ]
    },
    {
      "name": "Match Play",
      "widgets": [
        {
          "name": "Cycle Time",
          "type": "number"
        },
        {
          "name": "Can Pick Up",
          "type": "multicheckbox",
          "options": [
            "Ground Upright Cones",
            "Ground Tipped Cones",
            "Ground Cubes",
            "Sub 1 (Direct)",
            "Sub 2 High"
          ]
        },
        {
          "name": "Can Score In",
          "type": "multicheckbox",
          "options": [
            "High",
            "Medium",
            "Low"
          ]
        },
        {
          "name": "Scoring Methods",
          "type": "multicheckbox",
          "options": [
            "Manual",
            "Auto"
          ]
        },
        {
          "name": "Preferred Pickup Location",
          "type": "dropdown",
          "options": [
            "Ground",
            "Sub 1",
            "Sub 2 Low",
            "Sub 2 High"
          ],
          "defaultOption": true
        },
        {
          "name": "Comments",
          "type": "textarea",
          "colspan": 3
        }
      ]
    }
  ]
}

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.