A simple TODO app.
bundle exec rackup
App will be started at port 9292
by default
Running tests
bundle exec rspec
Currently, user creation is not considered.
It is assumed that the user exists and all the ToDos
are created for a user
who is identified via Authentication. Clearly for this, Authentication is also
not considered.
POST /api/todos
{
"description" : "Finish Assignment",
"list_id" : 1
}
Response
{
"message": "Todo created succesfully",
"result": {
"id": 1,
"description": "Finish Assignment",
"list": {
"id": 1,
"name": "default"
}
}
}
GET /api/todos/:id
Response
{
"id": 1,
"description": "study physics",
"due_date": null,
}
PUT /api/todos/:id
{
"description" : "updated todo"
}
Response
{
"message": "Todo updated succesfully"
}
DELETE /api/todos
{
"id": 1
}
Response
{
"message": "Todo removed succesfully"
}
POST /api/todos/:id/copy
{
"list_id": 3 // The target list id
}
Response
{
"message": "Todo added succesfully"
}
POST /api/todos/:id/move
{
"old_list_id": 3,
"new_list_id": 2
}
Response
{
"message": "Todo moved succesfully"
}
POST /api/lists
{
"name": "college"
}
Response
{
"message": "List created succesfully",
"result": {
"id": 3,
"name": "college",
"todos": []
}
}
GET /api/lists
Response
{
"count": 2,
"list": [
{
"id": 1,
"name": "default",
"todos": [
1
]
},
{
"id": 2,
"name": "college",
"todos": []
}
]
}
GET /api/list/:id
Response
{
"list": {
"id": 2,
"name": "college",
"todos": [1]
}
}
POST /api/todos/:id/reminders
{
todo_id: 1,
time_at: "2020-03-17T15:57:15+05:30"
}
Response
{
"message": "Reminder created successfully",
"result": {
"id": 1,
"todo_description": "study physics",
"time_at": "2020-03-17T15:57:15+05:30"
}
}