Exercise Tracker Done Need Feedback

Finally completed FreeCodeCamp project. I had to use aggregrate from mongodb to filter dates matching query. The app does return users data for requested date in query. As well as all users in mongodb(mlab) database. I am including my link to project with github uploaded code.
Live app and my code github uploaded code

The documentation could be a little better. For example, your user story:

  • I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of userId(_id). Return will be the user object with added array log and count (total exercise count).

and your request url:

GET /api/exercise/log?{id}

don’t seem to agree. If people ignore your user story and just follow the pattern of the request url, it works fine, but with APIs, the documentation is important.

I’ll test it out a little more when I get a chance.
Good luck.

I changed user stories accordingly to your suggestion. It is now saying the following.

I can add an exercise to any user by posting form data id(_id), description, duration, and optionally date to /api/exercise/add. If no date supplied it will use current date. Returned will the the user object with also with the exercise fields added.
I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of id(_id). Return will be the user object with added array log and count (total exercise count).

Hope this resolves confusion on mismatch between user stories and request url.

1 Like