Web API that allows users to create and manage their tasks. The ability to create user has no retrictions so anyone can create and account, request a token and start creating their tasks.
IMPORTANT NOTE: Make sure you create an auth token and add it inside the headers before interacting with user tasks endpoints.
- Clone the project
- Create a virtual venv:
python3 -m venv venv - Install dependencies:
pip install -r requirements.txt - Run the project:
python manage.py runserver
- Clone the project
- Make sure you have docker installed. Visit https://docs.docker.com/engine/install/ for more information.
- Move to inveratodolist project:
cd todo-challenge/inveratodolist - Build the image:
docker build -t todolist . - Run the project:
docker run -p 8000:8000 todolist
- POST: Create a new user token
- Request (application/json)
- Payload
{ "username": "newuser", "password: "password }
- Payload
- Response 201 (application/json)
- Body
{ "token": "auth_token" }
- Body
- GET: List all users.
- POST: Create a new user.
- Response 200 (application/json)
- Body
[ { "id": 1, "username": "Juan", "email": "juan@example.com" }, { "id": 2, "username": "Santiago", "email": "santiago@example.com" } ]
- Body
- Request (application/json)
- Payload
{ "username": "newuser", "email": "newuser@example.com" "password: "password }
- Payload
- Response 201 (application/json)
- Body
{ "username": "newuser", "email": "newuser@example.com" }
- Body
- GET: Retrieve user details.
- PATCH: Update user details.
- DELETE: Delete a user.
- Response 200 (application/json)
- Body
{ "username": "newuser", "email": "newuser@example.com" }
- Body
- Request (application/json)
- Payload
{ "username": "newusername", }
- Payload
- Response 201 (application/json)
- Body
{ "username": "newusername", "email": "newuser@example.com" }
- Body
- Response 204
- GET: List all users tasks.
- POST: Create a new user task.
- Response 200 (application/json)
- Body
[ { "id": 1, "title": "Do stuff", "description": "An explanation of your task", "date": "2023-10-10T08:00:00Z", "status": "Pendiente", "user": 11 }, { "id": 2, "title": "Doctor appointment", "description": "Ask for painkillers", "date": "2023-10-10T08:00:00Z", "status": "Pendiente", "user": 11 } ]
- Body
- Request (application/json)
- Payload
{ "title":"Go for a beer", "description":"Invite a friend", "date":"2023-10-10T08:00", }
- Payload
- Response 201 (application/json)
- Body
{ "id": 1, "title":"Go for a beer", "description":"Invite a friend", "date":"2023-10-10T08:00", "status": "Pendiente" }
- Body
- GET: Retrieve user task details.
- PATCH: Update user task details.
- DELETE: Delete a user task.
- Response 200 (application/json)
- Body
{ "id": 1, "title": "Go for a beer", "description": "Invite a friend", "date": "2023-10-10T08:00:00Z", "status": "Pendiente" }
- Body
- Request (application/json)
- Payload
{ "status": 2, #TODO change this so it allows strings. Temp solution 1: Pendiente; 2: Completado }
- Payload
- Response 201 (application/json)
- Body
{ "id": 1, "title": "Go for a beer", "description": "Invite a friend", "date": "2023-10-10T08:00:00Z", "status": "2" }
- Body
- Response 204
- GET: Search user tasks by title or date.
- Response 200 (application/json)
- Body
[ { "id": 1, "title": "Do stuff", "description": "An explanation of your task", "date": "2023-10-10T08:00:00Z", "status": "Pendiente", "user": 11 }, { "id": 2, "title": "Doctor appointment", "description": "Ask for painkillers", "date": "2023-10-10T08:00:00Z", "status": "Pendiente", "user": 11 } ]
- Body
There are a couple of things that are missing. I will try to update them soon.
- Integration tests
- Better handling of status
- Better handling of authorization