Open willgarrett64 opened 3 years ago
Assigning myself more out of interest than being able to help. I do know some basic python though.
I was thinking more tonight about requirements and what we'll need backend wise. Here are some random notes based on my knowledge but I think they are covered already
Check Username Route (but don't need this right away) Takes a string and checks db if username already in use Returns available or username in use
Register route Takes username and password Encrypts password and stores in db Returns success or error
Login route Takes username and password Get player from db by username to retrieve their password return error if username not found if found then compare encrypted password against the one entered return error if they don't match or success
Sessions Once login in success we need backend to return a 'session token', to present their logged in state and authenticate any requests that are for logged in players only.
There are a few options to do this maybe python already supports it too?
If player clicks 'continue as a guest' we still create a session but it can just be a randomly generated id.
Logout Destroy session token. As above.
Countdown Routes
Create/Edit Takes a countdown object and stores in the db - it'll take a username or the generated id.
Delete Delete from db by username or generated id
Get Countdowns Route Retrieve list of countdowns from db by username or generated id or default
At a really high level this is. I'll let more experienced people decide table structures, but maybe something like
Player table username and password
Countdown table countdown fields plus owner (generated id, username or default) which links back to primary key on player table
Maybe we can generate a default on startup script that can be stored there - initially for xmas.
And depending how we host it whether python app is rendering the pages or it's a separate app we might have to decide how to handle CORs
Thanks, @thecodehippo! This is very helpful.
I don't really know what is involved in doing this, so I will let the backend team take this issue on and create any new issues as you see fit. This one can be either edited or deleted.
The main things that will be needed:
I believe that the backend team can begin work on the log in/sign up part straight away, without needing to wait for the frontend team to actually build the sign up/in forms. You could create a separate issue later for linking up the front and back end.
Update:
After some research I started mapping out the steps needed for creating the backend. I will likely create a separate issue for most of these later on, but also keep them all as a list here. I will continue adding new steps as I figure out what they are. :) I am following this tutorial: Python Flask Tutorial