API Summary for To-Do App

 

API is built with Express.js and PostgreSQL and it manages task operations for the To-Do app. Key functionalities include:

 

1. Task Retrieval:

   - `/completedtasks`: Retrieves all tasks marked as "Complete," sorted by the due date.

   - `/progresstasks`: Retrieves all tasks in "In-Progress" status, also sorted by the due date.

   - `/todo_latest`: Fetches the most recently created task.

 

2. Task Creation:

   - `/todo`: Allows users to create a new task. Tasks are stored with a unique ID, title, description, due date, creation date, and an initial "In-Progress" status.

 

3. Task Updates:

   - `/update_task`: Updates the title, description, and due date of an existing task.

   - `/statuscomplete`: Marks a task as "Complete."

   - `/statusinprogress`: Changes a task's status back to "In-Progress."

 

4. Task Deletion:

   - `/todo`: Deletes a task by its unique ID.

 

The API utilizes modules pg-promise for PostgreSQL interactions, short-uuid for generating task IDs, and CORS for handling cross-origin requests. Task data is managed with JSON-based requests and responses.