Array is used instead of real database for operation.
sudo apt update
sudo apt install python3 python3-pip
pip3 install -r requirements.txt
flask run
docker build -t api-todo .
docker run -p 5000:5000 -d api-todo
pytest
id: unique id (using increment)
title: string
description: string
finished_at: dateTime (format d-m-Y H:i:s)
created_at: dateTime (format d-m-Y H:i:s)
updated_at: dateTime (format d-m-Y H:i:s)
deleted_at: dateTime (format d-m-Y H:i:s)
- /todo (POST) create todo
Sample Request : { "title": "Task Title", "description": "Description of task" }
- /todo (GET) get all todo
- /todo/ (GET) get todo by id
- /todo/ (PUT/PATCH) update Todo
Sample Request : { "title": "Task Title update", "description": "Description of task update" }
- /todo//finish (any method except delete) finish todo
- /todo/ (DELETE) soft delete todo
.
├── app.py
├── requirements.txt
├── public
├── test
│ └── test_todo_repository.py //unit test todo repository
└── todo
├── models.py //data models define
├── mapping.go //response computing & format
├── routers.go //router binding
└── repository.go //DB Operation