REST API for task management built with FastAPI.
- JWT authentication
- User registration and login
- CRUD operations for todos
- Alembic migrations
- API tests with pytest
- OpenAPI (Swagger) documentation
- Docker support
- Python 3.14
- FastAPI
- SQLAlchemy 2.0 (async)
- PostgreSQL
- Alembic
- Pydantic v2
- JWT (python-jose)
- Docker & Docker Compose
git clone git@github.com:ArtemVaska/task-manager-api.gitcd task-manager-apiCopy the example environment file and update it with your configuration:
cp .env.example .envUpdate the values in .env if necessary.
Build and run the application with Docker Compose:
docker compose up --buildThe API will be available at: http://localhost:8000
Swagger UI: http://localhost:8000/docs
ReDoc: http://localhost:8000/redoc
Create a migration:
docker exec -it fastapi-api alembic revision --autogenerate -m "message"Apply migrations:
docker exec -it fastapi-api alembic upgrade headRollback the latest migration:
docker exec -it fastapi-api alembic downgrade -1| Method | Endpoint |
|---|---|
| POST | /auth/register |
| POST | /auth/login |
| Method | Endpoint |
|---|---|
| GET | /todos |
| GET | /todos/{id} |
| POST | /todos |
| PATCH | /todos/{id} |
| DELETE | /todos/{id} |
python3.14 -m venv .venvsource .venv/bin/activatepip install -r requirements-dev.txtdocker exec -it fastapi-postgres psql -U postgresCREATE DATABASE todo_test_db;Quit the PostgreSQL console with \q command.
pytest