Now that the project has been fully assigned and my team and I have fleshed out the specs, roles, and requirements, I got to start working on the actual database. Since our project focused on AI tools and how to utilize them optimally, I started by asking ChatGPT how it would recommend setting up a database for a React Native Front-end and Flask back-end physical fitness tracking application. It started by recommending PostgreSQL, which I have never used before. I figured that learning a new DBMS would be useful as a tool under my belt. I set off to learn how to implement PostgreSQL and was first approached with the problem of how I was going to host and connect to my Database. Luckily, OSU provides us students with a coupon for Google Cloud Services, so I requested one and went over to their service setup to get started. With cost estimation, google stated that the cheapest available PostgreSQL instance would run at a cost of ~$3.38/day. With the $50 coupon OSU provided us, this would last 2 weeks, which was not long enough for us to reach the end of the term with a functioning project. I was unsure of whether I would be able to turn the instance on and off (you can) but it seemed to be a hassle overall. I talked to our grader and professor and decided that it would probably be best to run the database off the OSU MySQL server. Furthermore, I was already generating tables and an ERD in MySQL workbench, and so I was able to finish that work and forward-engineer a DDL. I used ChatGPT during this process to help with how information should be stored between tables. I specifically had trouble figuring out how we would track the entire workout history for all users, since we wouldn’t be making a new table for each user. After this trial and error portion, I got to work figuring out how to set up a Google cloud SQL server as a temporary point so we could interact with a database and write DML queries. After a 1.5 hour troubleshooting and reading documentation process, I got it up and running and was able to connect! ChatGPT was very unhelpful for this portion, providing very specific snippets of code that with little to no explanation about their functionality, and they didn’t fit the question at all. Finally, I was able to start adding our static data to our tables and am currently working on getting example data and talking with our back-end on how we’ll get the database connection setup through flask SQLAlchemy! Overall, a pretty eventful and productive 2 weeks!
Categories