- 用户登录
- 增加一个待办事项
- 删除一个待办事项
- 标记一个待办事项为已完成
- 编辑一个待办事项的具体内容
- 列出所有的待办事项
- 列表界面支持翻页
- 待办事项可以设置优先级
- 待办事项可以设置 expire date
- 支持按照不同的方式排序,如优先级,expire date
login
add, delete, complete todo, and list all todos
- Bootstrap v4
- reactstrap
- Django v1.8
- Django REST Framework v3.6(to support Django v1.8)
- Python v2.7
- PostgreSQL
# Init db
docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecret -d postgres:13-alpine
# Run backend
cd todo_backend
vim .env
pipenv install
pipenv shell
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver 8624
# Run app
cd ../react_app
npm install
npm start
# Done, open http://localhost:3000/ and login with the user created by
# `python manage.py createsuperuser`.
const todo = {
id,
title,
detail,
done,
priority,
expires,
createTime,
updateTime,
};
/*
对于 priority, 有(高, 中, 低, 无) 四种优先级.(参考 Todoist)
*/
- Add:
POST /todos
- Delete:
DELETE /todos/:id
- Mark as done:
PATCH /todos/:id
- Modify:
PUT /todos/:id
- List all:
GET /todos
- Login:
POST /users/login
- Get a casual user:
GET users/casual
- API version control
- Best practices for API versioning? [closed]