willianjusten / nba-remix

A simple app to show NBA games and scores/details.
https://nba.willianjusten.com.br
208 stars 31 forks source link

[Discussion] Choose a favorite team - filtering stuff #102

Open willianjusten opened 2 years ago

willianjusten commented 2 years ago

Intro

Hey guys, the project is going great, I can see many new changes and contributors, so I think we're good to go to the next step. That would be our MVP 2, which is user creation / favorite team.

Discussing with @fsilvaco and before with @helderburato and @adeonir, the initial idea was something like using Supabase or any other to create the user and from that, we could have a page to select favorite team and anything else needed after.

But now, thinking in a "middle step" before that, I think we could work with cookies to set the favorite team, and based on that, we use to filter. With that, it's simple to implement and simple for our users to use, without creating much friction at this beginning.

Ideas

Knowing all that above, we need to know:

How are we going to allow the user to select its favorite team?

I like the way GloboEsporte does, it has a dropdown to select the favorite team but if the user doesn't do anything, it's fine as well, so it's not intrusive/annoying, like a modal or anything that stops the user to choose their team.

image

If you guys have any ideas on how to do it, I'm all ears here =D

Strategy

Thinking about how to do it, I can see some steps (and some of them we can start without even having the UI xD)

ipetrini commented 2 years ago

I think it is going to be better to use cookies instead of localStorage since we won't be able to access it in the server, so it's probably going to be a little bit tricky if we go that way. With cookies we can use them server-side and therefore in the loaders to sort the games and stuff like that.

willianjusten commented 2 years ago

Yeah @ipetrini , you're completely right about it! Changing it.