Exercise Tracker
Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods:
- Clone this GitHub repo and complete your project locally.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
Your responses should have the following structures.
Exercise:
{
username: "fcc_test",
description: "test",
duration: 60,
date: "Mon Jan 01 1990",
_id: "5fb5853f734231456ccb3b05"
}
User:
{
username: "fcc_test",
_id: "5fb5853f734231456ccb3b05"
}
Log:
{
username: "fcc_test",
count: 1,
_id: "5fb5853f734231456ccb3b05",
log: [{
description: "test",
duration: 60,
date: "Mon Jan 01 1990",
}]
}
Hint: For the date
property, the toDateString
method of the Date
API can be used to achieve the expected output.
/** * * Your test output will go here * * */
Tests
- Waiting: 1. You should provide your own project, not the example URL.
- Waiting: 2. You can
POST
to/api/users
with form datausername
to create a new user. - Waiting: 3. The returned response from
POST /api/users
with form datausername
will be an object withusername
and_id
properties. - Waiting: 4. You can make a
GET
request to/api/users
to get a list of all users. - Waiting: 5. The
GET
request to/api/users
returns an array. - Waiting: 6. Each element in the array returned from
GET /api/users
is an object literal containing a user'susername
and_id
. - Waiting: 7. You can
POST
to/api/users/:_id/exercises
with form datadescription
,duration
, and optionallydate
. If no date is supplied, the current date will be used. - Waiting: 8. The response returned from
POST /api/users/:_id/exercises
will be the user object with the exercise fields added. - Waiting: 9. You can make a
GET
request to/api/users/:_id/logs
to retrieve a full exercise log of any user. - Waiting: 10. A request to a user's log
GET /api/users/:_id/logs
returns a user object with acount
property representing the number of exercises that belong to that user. - Waiting: 11. A
GET
request to/api/users/:_id/logs
will return the user object with alog
array of all the exercises added. - Waiting: 12. Each item in the
log
array that is returned fromGET /api/users/:_id/logs
is an object that should have adescription
,duration
, anddate
properties. - Waiting: 13. The
description
property of any object in thelog
array that is returned fromGET /api/users/:_id/logs
should be a string. - Waiting: 14. The
duration
property of any object in thelog
array that is returned fromGET /api/users/:_id/logs
should be a number. - Waiting: 15. The
date
property of any object in thelog
array that is returned fromGET /api/users/:_id/logs
should be a string. Use thedateString
format of theDate
API. - Waiting: 16. You can add
from
,to
andlimit
parameters to aGET /api/users/:_id/logs
request to retrieve part of the log of any user.from
andto
are dates inyyyy-mm-dd
format.limit
is an integer of how many logs to send back.