bgreenawald / madgab-online

1 stars 0 forks source link

Feature: Add user feedback button #34

Open JocelynYH opened 3 years ago

JocelynYH commented 3 years ago

Add a button that overlays over all screens, which will let the user submit feedback, for example, in regards to:

  1. UI suggestions and complaints
  2. Flagging clues
  3. Suggesting clues
  4. etc.

Initial thoughts - We should capture the page's state or maybe even entire dom/take a screenshot and record that data when the user submits. -- so, how exactly would the data structure look like? Where would this data go?

bgreenawald commented 3 years ago

The easiest solution to this would be to accept the user feedback as a form, tack on the current state of the game, and just save the whole thing to S3. We'd have to come up with some system to effectively parse through all the result, depending on how much feedback we get, but as long as our structure is consistent, that should be doable.

In terms of taking a screenshot, I actually have no idea how this would work. If the frontend encodes the screenshot and just includes it with the form data it sends, I figure it should just be included seamlessly, but I know embarrassingly little about how photos are encoded or what issues we might run into.

JocelynYH commented 3 years ago

Wouldn't it be better to store the data in a DB - probably structured?

I'm totally going out on a limb here, but, assuming we've figured out how to take the screenshot, there are options in the html to upload it. Where the screenshot goes after though ... that would be a good candidate for s3.

bgreenawald commented 3 years ago

In a perfect world, a structured DB would probably be best, but DB servers are $$$. As long as we are consistent with how we structure the data we push to S3, then we should still be able to effectively query it via SQL queries in Athena or a similar service.

I also saw people suggesting it would be possible to just encode the entire binary image in base 64 and essentially send it as free text to the backend. The backend could then theoretically re-encode as binary and send it to S3 along with all of the other data.

JocelynYH commented 3 years ago

hmm fair fair. How much do you think it'd be? I don't mind paying for it if it's not too much. I have no idea how we'd estimate potential costs though. Maybe aurora would be a good option? just brainstorming here. https://aws.amazon.com/rds/aurora/pricing/

Either way, SQL queries with Athena sounds good also.

Encoding the binary image to base 64 sounds like it's ringing a bell from random research I've done in the past.

As for actually taking the screenshot, seems like there are a ton of solutions out there. May take a bit of playing around with to get right, but definitely doable. https://stackoverflow.com/questions/4912092/using-html5-canvas-javascript-to-take-in-browser-screenshots

bgreenawald commented 3 years ago

We could run a cost analysis but at the scale, I imagine we're going to be running, I think the amount of feedback we're going to get is small enough that storing it in S3 and coming up with a couple of tools to organize and query it will be much more cost effective and honestly probably easier to manage.

What does "ringing a bell" mean in this context?

JocelynYH commented 3 years ago

Okey-doke, s3 it is then.

I built a frontend that let users upload CSVs, so a we could run the data through a model. And while reading about uploading different types of media, I remember vaguely reading something about photo uploading involving base 64 encoding.