/homeworks

Back-end API of a tasks manager application

Primary LanguageJavaScript

Homeworks

Back-end API of a tasks manager application

NodeJS Jest MongoDB heroku

Postman Documentation

https://documenter.getpostman.com/view/18745991/VUxSs5U9

Account Routes

Create an account

  • POST: /account/register
  • Params type: Body
  • Body params: firstName, lastName, email and password

Send account confirmation email

  • POST: /account/confirm
  • Params type: Body
  • Body params: email

Confirm account

  • PATCH: /account/confirm
  • Param type: Body
  • Body params: email and confirmationToken

Send reset password email

  • POST: /account/reset/password
  • Param type: Body
  • Body params: email

Reset password

  • PATCH: /account/reset/password/:id
  • Params types: Route and Body
  • Body params: password

Login

  • POST: /account/login
  • Param type: Body
  • Body params: email and password

Logout

  • POST: /account/logout
  • Param type: Header
  • Header param: x-access-token

Get user information

  • GET: /account/user
  • Param type: Header
  • Header param: x-access-token

Update user information

  • PATCH: /account/user
  • Param type: Header and Body
  • Body params: firstName and lastName (optional fields)
  • Header param: x-access-token

Subject Routes

Create a subject

  • POST: /subject/create
  • Params types: Body and Header
  • Body param: name
  • Header param: x-access-token

List all user subjects

  • GET: /subject/list
  • Param type: Header
  • Header param: x-access-token

Get a user subject by id

  • GET: /subject/:id
  • Params types: Header and Route
  • Header param: x-access-token

Update a user subject by id

  • PATCH: /subject/:id
  • Params types: Header, Body and Route
  • Body param: name
  • Header param: x-access-token

Delete a user subject by id

  • DELETE: /subject/:id
  • Params types: Header and Route
  • Header param: x-access-token

Task Routes

Create a task

  • POST: /task/create
  • Params types: Body and Header
  • Body param: name,subject and finalDate
  • Header param: x-access-token

List all user tasks

  • GET: /task/list
  • Param type: Header
  • Header param: x-access-token

Get a user task by id

  • GET: /task/:id
  • Params types: Header and Route
  • Header param: x-access-token

Update a user task by id

  • PATCH: /task/:id
  • Params types: Header, Body and Route
  • Body param: name,subject, finalDate and finished (optional fields)
  • Header param: x-access-token

Delete a user task by id

  • DELETE: /task/:id
  • Params types: Header and Route
  • Header param: x-access-token

Report Routes

Send report tasks to user email

  • GET: /report
  • Param type: Header and Query
  • Header param: x-access-token
  • Query Params:
    • status
      • Must be separated by commas.
      • 0 = In progress
      • 1 = Late
      • 2 = Finished
    • subject
      • Subject ids, separated by commas.
    • finalDate
      • Format: YYYY-MM-DD
      • To filter tasks of only one day, you can enter only one date.
      • It is possible to enter two dates separated by commas, and the final dates will be considered within the informed period.
      • It is not necessary to enter the dates in ascending order.
    • language
      • It is possible to inform the language of the report which, if not informed, will be generated by default in English.
      • en = English
      • es = Spanish
      • pt = Portuguese
  • Example = /report/?status=0,1,2&subject=630bbf78a43262ceca616379,630bbf7f588bd78b550a5f5a&finalDate=2022-08-16,2022-01-12&language=pt

Front-end wireframe

home-works-scope