Skip to content

Repository files navigation

Task Manager API

REST API for task management built with FastAPI.

Features

  • JWT authentication
  • User registration and login
  • CRUD operations for todos
  • Alembic migrations
  • API tests with pytest
  • OpenAPI (Swagger) documentation
  • Docker support

Tech Stack

  • Python 3.14
  • FastAPI
  • SQLAlchemy 2.0 (async)
  • PostgreSQL
  • Alembic
  • Pydantic v2
  • JWT (python-jose)
  • Docker & Docker Compose

Installation

git clone git@github.com:ArtemVaska/task-manager-api.git
cd task-manager-api

Run

Copy the example environment file and update it with your configuration:

cp .env.example .env

Update the values in .env if necessary.

Build and run the application with Docker Compose:

docker compose up --build

The API will be available at: http://localhost:8000

Swagger UI: http://localhost:8000/docs

ReDoc: http://localhost:8000/redoc

Database migrations

Create a migration:

docker exec -it fastapi-api alembic revision --autogenerate -m "message"

Apply migrations:

docker exec -it fastapi-api alembic upgrade head

Rollback the latest migration:

docker exec -it fastapi-api alembic downgrade -1

API

Authentication

Method Endpoint
POST /auth/register
POST /auth/login

Todos

Method Endpoint
GET /todos
GET /todos/{id}
POST /todos
PATCH /todos/{id}
DELETE /todos/{id}

Running tests

python3.14 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
docker exec -it fastapi-postgres psql -U postgres
CREATE DATABASE todo_test_db;

Quit the PostgreSQL console with \q command.

pytest

About

REST API for task management built with FastAPI, SQLAlchemy Async and PostgreSQL

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages