spruhaN / nutrition_pal

1 stars 1 forks source link

Schema/API Design comments (Kyle Reyes) #20

Open Proefey opened 1 month ago

Proefey commented 1 month ago

1) I’m surprised there is no endpoint to edit the user’s weight or height. A user may want to lower their weight to see their progress finalized or a user may grow in height (Keep in mind, not some users may be young and may not be done growing when they use this app). 2) There should be an endpoint to return the user. In fact, the data in the customer table other than the ID is never utilized, nor can it be seen by the user ever again. 3) There should be some indication on the goal unit whether or not it has been reached. It’s not a goal if the goal cannot be completed. 4) There should be endpoints to get the exercises and the muscle groups tables as a whole. The user cannot use some of the endpoints such as /workouts/musclegroup/{type} without knowing what “type” can be and should not have to search up the github to find it. 5) postWorkout does not need to return ID, the user shouldn’t have to be working with ID numbers besides their User ID number. 6) getWorkoutMuscleGroups shouldn’t have the user pass in an ID, users should not be working with ID numbers besides their User ID number. 7) There is no endpoint to update goals, which means a user is always stuck with the first goal they created. 8) A meal can consist of multiple ingredients, but you don’t want to copy a meal entry for every ingredient. You need a table that will map a meal to an ingredient (Although I’m not sure what benefit this will have for the user. It just seems cumbersome for a user to do manually and infeasible to automate). 9) There is no endpoint to see the goals, which makes naming them pointless. 10) getWorkoutsByDay should have an option to set what day (Or range of dates) to return the workouts of, otherwise I don’t see the reason of storing this information if it becomes inaccessible after a day. 11) dailyCalories should allow the user to somehow take into account any calories they burned. I don’t think calculating this would be easy, but some fitness apps give an estimation for calories burned that the user could input into the endpoint to get a more accurate dailyCalorie count. Alternatively, this could be an optional parameter in the postExcersise endpoint. 12) I think the meal table should have a quantity field. It would expedite the user’s calculation of calories and it would make searching through the meal table for a specific food easier as you wouldn’t need to include the quantity in the name.