geerlingguy / beast-challenge

A control system for MrBeast's 1-100 challenge
GNU General Public License v3.0
26 stars 1 forks source link

Integrate React frontend for vote tally display #17

Closed geerlingguy closed 1 year ago

geerlingguy commented 1 year ago

Right now I have the simple tally display set up from a Flask page with Javascript set to auto-refresh the page every 5 seconds. That's obviously not ideal since it gives little flexibility for front end seamless refresh.

After talking with @kamranpirwani on Slack, it sounds like he would prefer to use React + Framer.

So this issue is to track progress exposing the right data and getting React running in this repository (ideally we can spin up both Flask and React easily, maybe using Docker or just a couple commands, so we can deploy straight from this repo to the live server).

geerlingguy commented 1 year ago

I've created a path http://127.0.0.1:5000/live/tally which returns the current round result tally as JSON:

[
  {
    "label": "Chicken",
    "total": 4
  },
  {
    "label": "Steak",
    "total": 1
  },
  {
    "label": "Oatmeal",
    "total": 2
  }
]