Skip to content

christian3310/tasksys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task System

A Simple task system.

Before Start

The python version is 3.10

This project use poetry to manage packages and environment, please install it if you don't have poetry on your computer. Or, just run docker-compose to start the service.

pip install -U poetry

then run this command to do initialization.

poetry install

To activate virtualenv, exec the following command:

poetry shell

Runserver

Execute the following command to run the server, if you're out of virtualenv, add poetry run before this command.

flask --app app.main run

Or, run docker directly.

docker compose up

Usage

Task model

field type note
id int
name string
status bool 0 or 1

Get all tasks

GET /tasks

Response {
"result": [
        {"id": 1, "name": "name", "status": 0}
    ]
}

Create a task

POST /task

Request {
    "name": "買晚餐"
}

Response (201) {
    "result": {"name": "買晚餐", "status": 0, "id": 1}
}

Update a task

PUT /task/

Request {
    "name": "買早餐", "status": 1 "id": 1
}

Response (200) {
    "result": {"name": "買早餐", "status": 1, "id": 1}
}

Delete a task

DELETE /task/

Response (200)

Test

Run pytest directly, adding peotry run if you're out of the poerty shell.

# run with docker
docker exec -i tasksys poetry run pytest

About

a simple task system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published