Skip to content

Latest commit

 

History

History
92 lines (70 loc) · 2.69 KB

File metadata and controls

92 lines (70 loc) · 2.69 KB

Task API

Production-style Task Management REST API — the hands-on project for the Backend with FastAPI learning guides.

Learning? Start with the Learning Guide, not this file.


Quick start

python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
make dev

Dev accounts

Email Password Role
admin@example.com admin123 admin
user@example.com user123 user

Commands

Command Action
make dev Start dev server (SQLite)
make test Run pytest (15 tests)
make migrate Apply Alembic migrations
make docker-up Start API + Postgres

Concepts → code map

Concept Guide Code
Project structure 03 app/factory.py, app/api/
Database 04 app/db/, app/models/
Auth & JWT 05 app/core/security.py, app/api/v1/endpoints/auth.py
RBAC 06 app/core/rbac.py, app/services/task_service.py
Rate limiting 07 app/core/limiter.py
Errors & logging 08 app/core/exceptions.py
Testing 09 tests/
Docker 10 Dockerfile, docker-compose.yml
API reference 11 all endpoints

Project structure

task-api/
├── app/
│   ├── main.py / factory.py
│   ├── api/v1/endpoints/     # HTTP routes
│   ├── core/                 # config, security, rbac, errors
│   ├── db/                   # SQLAlchemy sessions
│   ├── models/               # User, Task
│   ├── schemas/              # Pydantic validation
│   ├── services/             # Business logic
│   └── middleware/           # Request logging
├── alembic/                  # Migrations
├── tests/
├── Dockerfile
└── docker-compose.yml

API endpoints (summary)

Method Path Auth
GET /api/v1/health No
GET /api/v1/ready No
POST /api/v1/auth/register No
POST /api/v1/auth/login No
GET /api/v1/auth/me Yes
CRUD /api/v1/tasks Yes
GET /api/v1/users Admin

Full reference: docs/11-api-reference.md