The todo_app service is a backend API for managing tasks. It uses SQLite as its database and provides a RESTful API to perform CRUD (Create, Read, Update, Delete) operations on tasks.
This module is part of the orchestrator_api project, which integrates multiple services to provide a unified platform for managing tasks and shortening URLs.
- Create tasks with a title and description.
- Mark tasks as completed or not completed.
- Retrieve all tasks or a single task by ID.
- Update and delete tasks.
- Python 3.9+
- Pip: Install Pip
- Docker (optional): For containerized deployment.
- Default:
http://localhost:8000
-
Get All Tasks
- GET
/items - Response:
[ { "id": 1, "title": "Sample Task", "description": "This is a task description.", "completed": false } ]
- GET
-
Get a Single Task
- GET
/items/{item_id} - Response:
{ "id": 1, "title": "Sample Task", "description": "This is a task description.", "completed": false }
- GET
-
Create a Task
- POST
/items - Request Body:
{ "title": "New Task", "description": "Details about the task", "completed": false } - Response:
{ "id": 2, "title": "New Task", "description": "Details about the task", "completed": false }
- POST
-
Update a Task
- PUT
/items/{item_id} - Request Body:
{ "title": "Updated Task", "description": "Updated details about the task", "completed": true } - Response:
{ "id": 1, "title": "Updated Task", "description": "Updated details about the task", "completed": true }
- PUT
-
Delete a Task
- DELETE
/items/{item_id} - Response:
{ "message": "Item deleted" }
- DELETE
-
Clone the repository:
git clone https://github.com/ivr0ma/todo_app.git cd todo_app -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
uvicorn main:app --host 0.0.0.0 --port 8000
-
Access the API: Open your browser or API client (e.g., Postman) and navigate to
http://localhost:8000/docsfor API documentation.
-
Build the Docker image:
docker build -t todo_sqlite:latest . -
Run the container:
docker run -d --name todo_sqlite -p 8000:80 -v todo_data:/app/data todo_sqlite:latest
-
Access the API: Open your browser or API client and navigate to
http://localhost:8000/docsfor API documentation.