Description
Tasks should be organizable by category (e.g. "Work", "Personal", "Learning"). Build the Category model, its CRUD, and link it to Task.
What to do
Acceptance Criteria
POST /categories/ creates a category
GET /categories/ lists all categories
POST /tasks/ accepts an optional category_id
GET /tasks/ includes the category object nested inside each task response
Difficulty
🟡 Intermediate
Description
Tasks should be organizable by category (e.g. "Work", "Personal", "Learning"). Build the Category model, its CRUD, and link it to Task.
What to do
CategorySQLAlchemy model inmodels.py:id,name(unique, not null)category_idforeign key to theTaskmodel (nullable — tasks don't have to have a category)relationshipfromTasktoCategoryCategoryCreate,CategoryResponserouters/categories.pywith full CRUD:POST,GET /,GET /{id},DELETE /{id}main.pycategory(nested) inTaskResponseAcceptance Criteria
POST /categories/creates a categoryGET /categories/lists all categoriesPOST /tasks/accepts an optionalcategory_idGET /tasks/includes the category object nested inside each task responseDifficulty
🟡 Intermediate