Skip to content
All projects

Project case study

Task Management API

A FastAPI task service with Argon2 password hashing, seven-day JWTs, SQLAlchemy user-task relationships, owner-scoped CRUD, and offset/limit pagination.

FastAPISQLAlchemySQLiteJWTArgon2
Open source repository

The problem

Let authenticated users manage their own tasks while keeping each query scoped to the current account.

Request flow

  1. 01Bearer token
  2. 02current-user dependency
  3. 03owner-scoped SQLAlchemy query
  4. 04task response

Example route: GET /tasks/?skip=0&limit=10

Implementation decisions

  • Connect users and tasks with a SQLAlchemy relationship and owner ID.
  • Hash account passwords with Argon2 and issue seven-day JWTs.
  • Use offset/limit pagination and update only fields supplied in the request.

Validation and failure handling

  • Read, update, and delete queries include both task ID and owner ID.
  • Missing or foreign-owned tasks return 404.