Habit Tracker
Habit Tracker is an application that is used to track and manage user habits. Create new Habits, track them, edit, finish, archive, label and more!
Because...
Habits don't restrict freedom, they create it
#
Auth RoutesIn Habit Tracker App
, the authentication is done with email
and password
credential fields.
You can refer documentation related to Authentication here
#
Profile RoutesThe following Route is related to profile user . This are Privately accessible route.
/api/user
#
1. GET Request URL:
/api/user
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { user: Object; }}
Functionality: This API call gets all user's data from the db.
#
Habit RoutesThe following Routes are relating to Habits. These are Privately accessible routes.
/api/habits
#
1. GET Request URL:
/api/habits
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { habits: Array; }}
Functionality: This API call gets all user's habits from the db.
/api/habits/:habitId
#
2. GET Request URL:
/api/habits/:habitId
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { habit: Object; }}
Functionality: This API call gets a particular user habit from the db.
/api/habits
#
3. POST Request URL:
/api/habits
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body:
{ habit: Object;}
Response Body:
{ data: { habits: Array; }}
Functionality: This API call creates a new user habit in the db.
/api/habits/:habitId
#
4. POST Request URL:
/api/habits/:habitId
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body:
{ habit;}
Response Body:
{ data: { habits: Array; }}
Functionality: This API call edits a user habit in the db.
/api/habits/:habitId
#
5. DELETE Request URL:
/api/habits/:habitId
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { habits: Array; }}
Functionality: This API call deletes a user habit in the db.
#
Label RoutesThe following Routes are relating to Labels. These are Privately accessible routes.
/api/labels
#
1. GET Request URL:
/api/labels
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { labels: Array; }}
Functionality: This API call gets all user's labels from the db.
/api/labels/:labelName
#
2. POST Request URL:
/api/labels/:labelName
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body: {}
Response Body:
{ data: { labels: Array; }}
Functionality: This API call adds a new label from the db.
/api/labels/:labelName
#
3. DELETE Request URL:
/api/labels/:labelName
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { labels: Array; }}
Functionality: This API call deletes a label from the db.
#
Archives RoutesThe following Routes are relating to Archives. These are Privately accessible routes.
/api/archives
#
1. GET Request URL:
/api/archives
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { archives: Array; }}
Functionality: This API call gets all user's archives of a particular project from the db.
/api/archives/:habitId
#
2. POST Request URL:
/api/archives/:habitId
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body: {}
Response Body:
{ data: { archives: Array, habits: Array }}
Functionality: This API call archives a habit from the db.
/api/archives/restore/:habitId
#
3. POST Request URL:
/api/archives/restore/:habitId
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body: {}
Response Body:
{ data: { archives: Array, habits: Array }}
Functionality: This API call restores an archived habit from the db.
/api/archives/delete/:habitId
#
4. DELETE Request URL:
/api/archives/delete/:habitId
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { archives: Array; }}
Functionality: This API call deletes an archived habit from the db.