A simple console-based Todo List application where you can add, delete, complete tasks.
These instructions will help you set up the project on your local machine for development and testing purposes.
What things you need to install the software and how to install them:
A step-by-step guide to getting a development environment running:
Clone the repository to your local machine.
git clone https://github.com/emkbt/DT--Kilbertus--5--ToDoList--
Navigate to the project directory.
cd DT--Kilbertus--5--ToDoList--
Run the project.
python todo_app.py
Currently, this project does not have automated tests. However, you can manually test the functionality by running the application and checking if the basic operations (adding, deleting, completing tasks) work as expected.
The manual tests cover the following scenarios:
Adding a Task:
Deleting a Task:
Completing a Task:
A REST API was implemented into this project by waternewt. This API was built using the Flask framework. All of the routes take in the api_key
paramater.
You can use the postman json (Todo List.postman_collection.json
) in the Testing folder, to import this project into Postman. This postman json will include example usages on each of the routes/methods.
This route tests if the API key is a valid one. Here is an example:
Example Input
curl --location 'http://127.0.0.1:8000/auth?api_key=83a426cd48bdbae86c217bf2217bd038'
Example Output
{
"status": 200,
"success": true,
"username": "demo"
}
The route /add
only accepts the method PUT
request method. It takes in one required description
header, and one optional due_date
header.
Example Input
curl --location --request PUT 'http://127.0.0.1:8000/add?api_key=83a426cd48bdbae86c217bf2217bd038' \
--header 'description: Study' \
Example Output
{
"completed": false,
"description": "Study",
"due_date": null,
"status": 200,
"success": true
}
The route /tasks
only accepts the GET
request method. It (just like all the other routes), takes in the api_key
paramater.
Example Input
curl --location 'http://127.0.0.1:8000/tasks?api_key=83a426cd48bdbae86c217bf2217bd038'
Example Output
{
"status": 200,
"success": true,
"tasks": [
{
"completed": true,
"description": "Study",
"due_date": null
},
{
"completed": false,
"description": "Homework",
"due_date": null
}
]
}
The route /delete
only accepts the DELETE
request type.
Example Request
curl --location --request DELETE 'http://127.0.0.1:8000/delete?api_key=83a426cd48bdbae86c217bf2217bd038' \
--header 'description: Study'
Example Response
{
"status": 200,
"success": true
}
The route /complete
only accepts POST
request method. It accepts the required description
header, and the optional due_date
header.
Example Request
curl --location --request POST 'http://127.0.0.1:8000/complete?api_key=83a426cd48bdbae86c217bf2217bd038' \
--header 'description: Study'
Example Response
{
"status": 200,
"success": true
}
Since this is a simple console application, formal coding style tests may not be necessary. However, it's a good practice to follow PEP 8 or other relevant style guides.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details