
- Add /api/todos/search endpoint with text search capability - Implement filtering by completed status - Include pagination and result count - Update documentation with new endpoint details generated with BackendIM... (backend.im)
Simple Todo App
This is a FastAPI application that implements a simple Todo API.
Features
- Create, read, update, and delete todo items
- Search todos by text query with optional filtering
- Health check endpoint
- SQLite database for data storage
- FastAPI automatic documentation
Getting Started
Prerequisites
- Python 3.7+
- Pip package manager
Installation
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
Running the Application
uvicorn main:app --reload
The server will start at http://localhost:8000
API Documentation
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
GET /api/todos
: List all todosGET /api/todos/search
: Search todos by text queryPOST /api/todos
: Create a new todoGET /api/todos/{todo_id}
: Get a specific todoPUT /api/todos/{todo_id}
: Update a todoDELETE /api/todos/{todo_id}
: Delete a todoGET /health
: Check application health
Search Endpoint
The search endpoint allows searching todos by text query with additional filters:
GET /api/todos/search?q=search_term&completed=true&skip=0&limit=10
Parameters:
q
: (required) Search text to match in title or descriptioncompleted
: (optional) Filter by completion status (true/false)skip
: (optional) Number of records to skip for paginationlimit
: (optional) Maximum number of records to return
Description
Languages
Python
95.3%
Mako
4.7%