Skip to content

kyoabhiem/API-Todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Assigment

Database

Array is used instead of real database for operation.

Get started

Running without docker

sudo apt update
sudo apt install python3 python3-pip
pip3 install -r requirements.txt
flask run

Running with docker

docker build -t api-todo .
docker run -p 5000:5000 -d api-todo

Run unit test

pytest

Todo Data Structure

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)

API Schema

  • /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

Folder Structure

.
├── 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published