This repository contains a simple web application built using Flask, a micro web framework for Python. The application serves as a task management system where users can create, view, and mark tasks as complete.
To run the application, follow these steps:
-
Install the required dependencies by running the following command in your terminal:
pip install Flask Flask-Bootstrap
-
Clone this repository to your local machine:
git clone [<repository_url>](https://github.com/0xJeu/To-Do-List.git)
-
Navigate to the repository directory:
cd [<repository_directory>](https://github.com/0xJeu/To-Do-List.git)
-
Run the application by executing the following command:
python app.py
-
Open your web browser and go to
http://localhost:5000
to access the application.
-
Task Creation: Users can create new tasks by providing a title and description. Optionally, a task can be marked as completed during creation.
-
Task Listing: All existing tasks are displayed on the main page in a list format. Each task shows its title, description, and completion status.
-
Mark as Complete: Users can mark a task as complete by sending a PUT request to the
/tasks/<task_id>
endpoint.
-
GET /tasks
: Retrieve the list of tasks in JSON format. -
POST /tasks
: Create a new task. Requires a JSON payload withtitle
anddescription
fields. Optionally, you can include acompleted
field to specify the completion status. -
PUT /tasks/<task_id>
: Mark a task as complete. Requires thetask_id
as part of the URL.
The code consists of the following components:
-
app.py
: The main application file. It sets up the Flask app, defines the routes, and contains the logic for managing tasks. -
templates/index.html
: The HTML template used to render the main page. It displays the list of tasks and provides a simple user interface. -
Task
Class: A class representing a task object. It includes attributes liketask_id
,title
,description
, andcompleted
.
Contributions to this project are welcome! If you find any issues or want to add new features, feel free to create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Note: This README provides a general overview of the application and its functionality. For detailed instructions on using specific API endpoints and interacting with the application, refer to the API documentation or inline comments in the source code.