This is a simple todo app in Flask and React. It features a orderable todo list with a SQLite database attached to it.
Make sure you have Python installed. Run the following commands in your favourite terminal to install depenencies and get started.
pip install Flask
python setup.py
bower install
This will install Flask (if it isn't installed allready), install our databse and then install the needed front-end depenencies.
The app is started by running python app.py
in your favourite terminal.
The backend is fairly monolithic, with these endpoints:
GET /todos.json
– fetch all todosPOST /todos.json
– create new todo, send todo content astitle
POST /todos/complete_all.json
– mark all todos as completedPOST /todos/<int:todo_id>/status.json
– change status of the todo with the idtodo_id
, send todo status ascompleted
POST /todos/set_order.json
– set order of the todos, recieves json array nameorder
:[{id: <todo_id>, order: <the todos position, int>},...]
The React classes are structured like this:
- TodoApp
- TodoForm
- TodoList
- [Todo,Todo,Todo,...]
You're laughing right now, I understand that.
When there is time, this should be done:
- Clean up
todo_app.js
and all it's ugly ajax calls - Move database helpers in
app.py
to separate file - Improve the semi-scetchy draggable function, so that it can be updated instantly etc
- Align checkbox better