To-Do List REST API

A Rust REST API for managing a to-do list. It supports full CRUD on tasks, many-to-many tagging, filtering by completion status, priority range, due-date range, and tags, and sorting by priority or due date. Data is stored in PostgreSQL through Diesel migrations and a pooled connection, and integration tests cover every endpoint.
Endpoints
| Method | Path | Does |
|---|---|---|
GET |
/health |
Health check |
GET |
/tasks |
List tasks, with filters and sorting |
POST |
/tasks |
Create a task (with tags) |
GET |
/tasks/{id} |
Get one task |
PATCH |
/tasks/{id} |
Partially update a task, including its tags |
DELETE |
/tasks/{id} |
Delete a task |
GET /tasks accepts completed, priority_min/priority_max, due_date_before/due_date_after, tags (comma-separated, all must match), sort_by (priority or due_date), and sort_ascending.
curl "http://localhost:8080/tasks?completed=false&priority_min=0.7&sort_by=due_date"
Data model
tasks: description, optional priority (0.0–1.0), optional due date, completion flag, and timestamps. Indexed on completion, priority, and due date.tags: unique tag names.task_tags: a junction table for the many-to-many relationship, withON DELETE CASCADEforeign keys, so deleting a task or tag cleans up its links.
Structure
Routes, handlers, models, and error handling live in separate modules. Errors are returned as consistent JSON (for example, a 404 with an error message), and the schema is managed with Diesel migrations. The integration test suite covers the health check and creating, fetching, filtering, updating, and deleting tasks.