spruhaN / nutrition_pal

1 stars 1 forks source link

Schema:API Design comments (Asa Grote) #15

Open AsaGrote opened 1 month ago

AsaGrote commented 1 month ago

Suggestions for Improvements:

  1. It appears as though workout is used to post a completion of a single exercise, such as a push-up or pull-up routine. In my mind, a workout is a collection of exercises. I would create an exercise table on top of your existing workout table. Then I would suggest allowing users to create exercises as they are able to create workouts, then use exercises to build full workouts.

  2. I would suggest adding additional endpoint functionality for getting information about caloric intake. As a user, it would be nice to get more information about macros, i.e. protein.

  3. It is inconvenient that once the day has passed, you cannot view the workouts you have posted. I suggest adding another endpoint that allows you to see all workouts posted.

  4. Similarly, I suggest adding an endpoint that allows users to see all meals that have been posted, since a user might want to view their diet across a longer span of time.

  5. Allow the user a way to select which goals they want as active. Code logic relies on user goals, so if a user has multiple goals, they should be able to select which should drive the API.

  6. Allow the user to delete goals they no longer have or have already completed.

  7. There are two endpoints that begin with /workout/ and two that begin with /workouts/. These should be adjusted so that all four begin the same.

  8. In the response body of the /meal/{customer_id}/day endpoint, the "type" attributed of the returned objects looks to be null for all entries. What is the purpose of this field?

  9. There is one endpoint that begins with /daily_calories/. This organization could be consolidated, especially as the API grows. It could be better to incorporate this endpoint with /meal/, or change all three endpoints that relate to tracking calorie intake to start with the same thing.