Simple TodoList app using django and the django rest framework in the backend on an alpine python image to provide a REST api. The frontend uses React to access the REST api and deal with login and displaying the todos. The frontend is getting bundled with Webpack and than served with a nginx docker image. The backend test are written with djangos native testframework, the frontend tests are written with enzyme and jest.
Bundling with webpack and docker-compose build:
./install.sh
Running tests:
./test.sh
or:
./test.sh (backend | frontend)
Run Project
docker-compose up
Access TodoList:
http://localhost:8080/
Setup django project:
docker-compose run backend sh -c "django-admin.py startproject app ."
Retrieve all tasks
GET http://localhost:8000/api/tasks
Create a new task:
POST http://localhost:8000/api/tasks
payload:
{
"title": "",
"completed": false,
"priority": null,
"description": "",
"created_date": null,
"due_date": null
}
POST http://localhost:8000/api/user/create/
payload:
{
"email": "",
"password": "",
"name": ""
}
Get user token:
POST http://localhost:8000/api/user/token/
payload:
{
"email": "",
"password": ""
}
GET http://localhost:8000/api/user/settings
Change user settings:
PUT/PATCH http://localhost:8000/api/user/settings
payload:
{
"email": "",
"password": "",
"name": ""
}