🎯 Hands-on Portfolio Deliverable: Build a complete production-grade FastAPI TODO API with auth, CRUD, tests, and Docker containerization using AI pairing. Track your time across each phase to baseline your AI velocity.
The brief
Build a TODO API with auth, CRUD, tests, and Docker deploy — entirely AI-assisted. Track your time per phase. Goal: get baseline data on your AI-coding speed.
Requirements
- POST /signup, POST /login (JWT auth).
- CRUD /todos (per-user; only own todos accessible).
- Filter, paginate, sort todos.
- Mark complete/incomplete.
- Tests (≥80% coverage).
- Dockerfile.
- README with setup + curl examples.
Setup (5 min)
mkdir todo-api && cd todo-api
git init
Create a CLAUDE.md (or .cursorrules):
# TODO API
## Stack
- Python 3.12, FastAPI, SQLAlchemy 2.0, Pydantic v2.
- SQLite for dev, Postgres-ready.
## Conventions
- src/ layout.
- Separate models.py (SQLAlchemy), schemas.py (Pydantic), routers/.
- JWT auth via Depends(get_current_user).
- pytest with TestClient.
## Style
- Type hints on all functions.
- Pydantic v2 syntax (model_config, not class Config).
- Logging via structlog with extra={}.
Time-tracking template
Throughout the build, log time per phase:
| Phase | Time | AI usage |
|--------------------|------|-------------------|
| Setup | __ | minimal |
| Models + schemas | __ | scaffold then review |
| Auth | __ | review mode (boilerplate) |
| CRUD endpoints | __ | review mode |
| Tests | __ | review mode |
| Docker | __ | review mode |
| README | __ | review mode |
| Total | __ | |
Step 1: Scaffold (15 min target)
Prompt your AI:
"Scaffold a FastAPI TODO API: User model with email/password_hash; Todo model with title/description/completed/owner_id. Pydantic schemas for create/update/response. Files: src/todo_api/main.py, models.py, schemas.py, db.py, auth.py, routers/auth.py, routers/todos.py. Just signatures and TODO comments — no implementations yet."
AI generates structure. Review:
- All files in the right places?
- Signatures match patterns?
- Pydantic v2 syntax (per CLAUDE.md)?
Step 2: Implement auth (20 min target)
"Implement auth.py and routers/auth.py based on the scaffold. Use bcrypt via passlib for password hashing; python-jose for JWT. /signup and /login endpoints. Use Depends pattern."
AI implements. You verify:
- Bcrypt used correctly.
- JWT signed and verified.
- 401 on bad creds (don't leak user existence).
Step 3: Implement TODOs CRUD (25 min target)
"Implement routers/todos.py. All endpoints require auth (use get_current_user). User only sees own todos. Endpoints: list (with filter completed, pagination), create, get, update (PATCH partial), delete. Use Mapped style for SQLAlchemy."
AI implements; you verify ownership checks, pagination, error responses.
Step 4: Tests (30 min target)
"Generate pytest tests for all endpoints. Use a TestClient + test DB fixture with transaction rollback. Override get_current_user for protected endpoints with a test_user fixture. Cover: happy path, missing auth, accessing other user's todos (403, or 404 to avoid leaking existence), 404 on missing todo, validation errors."
For missing-auth tests, disable the get_current_user override; restore overrides after each test. AI generates tests. Run them; verify pass.
If pass: great. If fail: that's a bug — investigate (AI vs your code).
Target: ≥80% coverage.
Step 5: Dockerfile + README (10 min target)
"Generate a multi-stage Dockerfile using uv. And a README with: project description, setup steps (uv sync), env vars needed, run instructions, example curl commands for each endpoint."
AI generates. Test the Docker build locally.
Step 6: Reflect
After completion:
# Reflection
## Total time: __ hours
## What AI was great at:
- ...
## What AI struggled with:
- ...
## Things I had to manually fix:
- ...
## My speed vs estimate:
Without AI, this would have taken __ hours.
With AI: __ hours.
Speedup: __x.
## What I'd do differently next time:
- ...
This reflection is the actual learning. Tracking baselines reveals where AI shines and where it doesn't.
Deliverables
- Working TODO API.
- All endpoints respond correctly.
- Tests pass with ≥80% coverage.
- Dockerfile builds and runs.
- README with setup.
- Time-tracking table.
- Reflection markdown.
What you'll learn
- The full AI-coding cycle on a real project.
- Where AI accelerates (scaffolding, tests, boilerplate) vs slows you (subtle business logic).
- Your personal baseline speedup.
- Habits of effective prompts.
Stretch
- Add tags to TODOs (many-to-many).
- Add sharing (users can share TODOs with others).
- Deploy to Fly.io / Railway (use Build 6 of FastAPI course).
📊 100-Point Evaluation Rubric
| Evaluation Dimension | Weight | Target Standard (Pass ≥ 80%) |
|---|---|---|
| 1. Functional Endpoints & Auth | 25 pts | Complete JWT auth flow (/signup, /login) with secure password hashing. CRUD /todos endpoints enforce strict per-user ownership and standard HTTP status codes. |
| 2. Test Suite & Coverage | 25 pts | Comprehensive pytest suite covering happy path, missing auth (401), unauthorized resource access (403 or 404 to avoid leaking resource existence), validation errors (422), and missing items (404). Target coverage ≥ 80%. |
| 3. Clean Architecture & Conventions | 25 pts | Adheres to CLAUDE.md / .cursorrules conventions: src/ layout, separated models/schemas/routers, Pydantic v2 schemas, complete type annotations, and working multi-stage Dockerfile. |
| 4. Time Tracking & Reflection | 25 pts | Completed log of actual time and AI usage per phase, plus an overall estimated solo-versus-actual comparison, paired with reflection on AI acceleration, failure modes, and prompt techniques in REFLECTION.md. |
📤 Submission Instructions & Guidelines
- Deliverable Formats:
- Option A (Recommended): Upload a single
.ziparchive containing your project directory:src/,tests/,Dockerfile,README.md,CLAUDE.md, andREFLECTION.md. - Option B: Upload your
REFLECTION.mdorREADME.mdand include your GitHub repository link in the Submission Notes box below.
- Option A (Recommended): Upload a single
- Pre-Submission Verification:
- Run
pytest --cov=srcto verify your test suite executes and passes with ≥80% coverage. - Run
docker build -t todo-api .and verify the container builds cleanly. - Confirm all endpoints function with curl or the OpenAPI docs (
/docs).
- Run
- Submit Your Work:
- Use the file dropzone below to upload your
.ziparchive (up to 50MB). - Add any comments or observations in the Submission Notes box.
- Click Submit Assignment to record your submission and complete this build.
- Use the file dropzone below to upload your