KieranBond / Tomorrowify

Giving you a playlist for tomorrow.
https://tomorrowify.com
MIT License
4 stars 2 forks source link

Prevent duplicate signups #18

Open KieranBond opened 4 months ago

KieranBond commented 4 months ago

We should track the users who are signed up so that if they try to sign up again, we can avoid trying to update their playlists' twice.

We may be able to do this by checking if permission has already been granted, otherwise we have to enable removal from our tracking also.

MaheshS08 commented 2 weeks ago

Hi, Can i work on this?

KieranBond commented 2 weeks ago

Hi, go for it @MaheshS08

MaheshS08 commented 1 week ago

Thank you, would you mind explaining this is in more detail ?

KieranBond commented 1 week ago

Thank you, would you mind explaining this is in more detail ?

Sure @MaheshS08 .

When a user signs up, we get a token from Spotify that we then send to our Lambda service. I think the token we receive is likely to be different every time (might be worth verifying this), even from the same user.

This token expires so we then fetch a different token from Spotify that allows us to continue performing API calls on their behalf. We should check if we already have a token for the user signing up - you might need to save more details about them in the db or do a lookup of their unique id before saving to do this.

Does that make sense?

MaheshS08 commented 1 week ago

Hi @KieranBond , I am facing some issue with application setup locally, could you please mention some instructions on this?

KieranBond commented 1 week ago

Have you read the readme @MaheshS08 ? What specifically are you struggling with?

MaheshS08 commented 1 week ago

I need to run make run-website in src/Frontend folder right?, and i'm getting below error: image

And when I run WebApi I'm seeing :

System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (localhost:8000) ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.

KieranBond commented 1 week ago

You'll need to install GNU Make to run the command, or you can run the contents of the command in a terminal instead - it's essentially a shortcut for a Node command. Check out the makefile file to see what it's trying to run for you.

It sounds like you may need to run Docker compose up in the terminal at the root of the project to get the database running for your API to start up as that's on port 8000. Sorry, that's probably missing from the readme.

Does that make sense?

KieranBond commented 1 week ago

Oh and I can see you're running make run-website from the frontend folder. That needs to be done from the root folder also as the makefile is at the root.

MaheshS08 commented 1 week ago

Hi @KieranBond , I am able to run webapi after docker compose up command. Can I access http://localhost:8000/ in browser because i'm getting Site can't be reached?

KieranBond commented 1 week ago

The frontend will be accessible at http://localhost:8080, the backend will be http://localhost:5213 if running using the http launchsettings profile @MaheshS08

KieranBond commented 1 week ago

The database is at http://localhost:8080

MaheshS08 commented 1 week ago

Both frontend and database are same ? @KieranBond

KieranBond commented 1 week ago

Oh, sorry, typo on my end. The database is on port 8000 not 8080 @MaheshS08

MaheshS08 commented 1 week ago

But when I get localhost:8000 in browser it says site refused to connect , do I need to do anything before ? @KieranBond

KieranBond commented 1 week ago

That's because you're trying to connect to the database in your browser.

If you're trying to see the website then that's on port 8080

KieranBond commented 1 week ago

Your backend should be what connects to the database, as its configured to in the appsettings.development.json file

KieranBond commented 2 days ago

How's this going @MaheshS08?

MaheshS08 commented 1 day ago

Hi @KieranBond , sorry for the delayed response. I'm currently out if station and will be back on Tuesday. Sorry to inform this.

Let me know if that works for you

KieranBond commented 1 day ago

No worries, just checking - let me know if you need any help @MaheshS08