TODO App

Table of Contents


Commands

yarn
yarn start
yarn start:dev

yarn test
yarn test:cov

Plans

v1.0.0: Features

  • Todo
    • Create
    • Get List
    • Get by ID
    • Update by ID
    • Delete by ID

v1.1.0: Features

  • Status
    • TODO
    • DOING
    • DONE
  • Improve README

v1.2.0: Features

  • Dates
    • createdDate: string
    • startDate?: string
    • dueDate?: string
    • updatedDate: string
    • deletedDate?: string
  • Todo Archive Status

v2.0.0: Features

  • API Versioning
  • Improve Response
  • Pagination
  • Filter in Get List
  • Rename into Task

Usages

Get all

curl --location --request GET 'localhost:3000/todo'

Response

[
  {
    "id": 0,
    "name": "Test Title 1",
    "description": "Test Desc 001",
    "status": "TODO"
  },
  {
    "id": 1,
    "name": "Test Title 2",
    "description": "Test Desc 002",
    "status": "TODO"
  }
]

Get by ID

curl --location --request GET 'localhost:3000/todo/0'

Response

{
  "id": 0,
  "name": "Test Title 1",
  "description": "Test Desc 001",
  "status": "TODO"
}

Create Todo

curl --location --request POST 'localhost:3000/todo' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Test Title 1",
    "description": "Test Desc 001"
}'

Request

{
  "name": "Test Title 1",
  "description": "Test Desc 001"
}

Response

{
  "id": 0,
  "name": "Test Title 1",
  "description": "Test Desc 001",
  "status": "TODO"
}

Update Todo by ID

curl --location --request PATCH 'localhost:3000/todo/0' \
--header 'Content-Type: application/json' \
--data-raw '{
    "status": "DOING"
}'

Request

{
  // "name": "Test Title 99",
  // "description": "Test Desc 099",
  "status": "DOING" // TODO, DOING, DONE
}

Response

{
  "id": 0,
  "name": "Test Title 1",
  "description": "Test Desc 001",
  "status": "DOING"
}

Delete Todo by ID

curl --location --request DELETE 'localhost:3000/todo/0'

Response

Deleted Todo ID: 0 success