Michael Kozub – Week 2

This week I created a new “followers” table, got a Flask server working, and got custom GET endpoints working. One endpoint returns all users and the other accepts custom parameters to query all users a given user “follows”. Below are bullet points in what I was able to accomplish at a more detailed level:

  • Used ChatGPT to create the Followers table. Asked a few questions to fine tune my request and came up with an insert statement that prevents a follower to follow a user more than once (duplicate prevention).
  • Used ChatGPT to create an insert statement where I (user id 1) will follow all of the other users in our user table.
  • Had ChatGPT help me create a reusable MySQLConnector.py (since renamed). The original intention behind this GPT request was to enable the frontend to call and endpoint or a function to retrieve data from our AWS database. 
  • Had ChatGPT help me create a config.py so that if we have multiple files making requests to our database, we only have to manage the credentials in one file. 
  • Had ChatGPT create Flask server code which I was able to get working with the MySQLConnector. I then renamed that to Server.py. Spent a bit of time trying to figure out how to run Flask locally.
  • Ran into several CORS errors when trying to get this working on the Frontend with Kevin’s code to display the table on one of the pages. There was an issue with Flask and localhost using port 5000 for something AirPlay related. This has since been resolved. 

Tables still needed at a glance: 

  • Settings 
  • BrokerageAccounts 
  • Transactions 
  • SomethingForUserConnections?

Example response of the get_all_followers GET call with a custom parameter where I retrieved everybody user 1 follows:

What the followers table looks like:

Print Friendly, PDF & Email

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *