Flask web application and RESTful API for it
- User registration;
- Password recovery via email using JWT tokens;
- Tasks creation through a specialized form;
- Browse all registered users/tasks;
- User statistics and a task filter based on it (which works without a page reload);
- Personal task pages with all available information;
- Task editing and removing functionality;
- The application supports task management without using a web interface: see the "API" chapter below.
![]() |
![]() |
![]() |
---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- HTML templates
- base models
- unit tests
- user credentials processing
- JWT tokens for emails
- API and unit tests for it
- Javascript-based task filter
HTTP Method | Resource URL | Notes |
---|---|---|
POST |
/api/tasks | Register a new task |
GET |
/api/tasks | Return the collection of all tasks |
GET |
/api/tasks/<id> | Return a task |
PUT |
/api/tasks/<id> | Modify a task |
DELETE |
/api/tasks/<id> | Delete a task |
- add access tokens
- API errors may return JSON responses
- write tests before a merge
cd Task_manager
- Create a virtual environment
pip install -r requirements.txt
flask run
- Navigate to
http://127.0.0.1:5000/
in your browser - Use the following credentials to log in
login: test
password: test
- Activate the virtual environment
python tests.py
- Run the application
- Start an emulated email server:
python -m smtpd -n -c DebuggingServer localhost:<your_port>
- Set two environment variables
export MAIL_SERVER=localhost
export MAIL_PORT=<your_port>
- Navigate to
http://127.0.0.1:5000/reset_password_request
(can be done through the login page) - Request password reset for this email:
[email protected]
- Check the server for the reset link
- Activate the virtual environment
- Get a token from
http --auth test:test POST http://localhost:5000/api/tokens
- Run any of the following commands (add these keys and values:
-A bearer --auth <token>
)
http GET http://localhost:5000/api/tasks/1
http GET http://localhost:5000/api/tasks
http POST http://localhost:5000/api/tasks title="API test" description="check any API route" executor_id=1
http PUT http://localhost:5000/api/tasks/1 title="endpoint check"
http PUT http://localhost:5000/api/tasks/1 description="send HTTP request to any API route"
http PUT http://localhost:5000/api/tasks/1 status="Completed"
http DELETE http://localhost:5000/api/tasks/1
- [code structure] use the application factory pattern;
- add pagination for the user and task lists;
- multi-user support for a single task;
- add a reviewer role, without whose consent it won't be possible to set the status "completed" or change the task
I would like to thank Miguel Grinberg for his works on web development. They helped me to take the first steps in understanding the topic and in creating this project. Miguel has a personal blog that you can read by following the link. Moreover, he is the author of a number of courses and books that you can find at this link