A simple task manager API built with FastAPI, SQLAlchemy, and SQLite. This application allows you to add, delete, and mark tasks as done, as well as retrieve all tasks and tasks by ID.
Note: This repository was created by a GenAi Agent.
- Create new tasks
- List all tasks
- Get task by ID
- Mark tasks as completed
- Delete tasks
- Uses SQLite for storage
- Docker Compose setup for easy deployment
- Standard pip package manager for Python dependencies
To run the unit tests:
pytest -vThis project uses flake8, black, and isort for code quality:
# Run flake8 to check code quality
flake8 .
# Run black to check code formatting
black --check .
# Run isort to check import sorting
isort --check-only .
# Format code with black and isort
black .
isort .This project includes a GitHub Actions workflow that runs on push to the main branch and on pull requests. The workflow:
- Installs dependencies
- Runs linting checks (flake8, black, isort)
- Runs unit tests with pytest
- Docker and Docker Compose
docker-compose up -dThe API will be available at http://localhost:8000
Once the application is running, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
GET /- Welcome messagePOST /tasks/- Create a new taskGET /tasks/- List all tasksGET /tasks/{task_id}- Get a task by IDPUT /tasks/{task_id}/complete- Mark a task as completedDELETE /tasks/{task_id}- Delete a task
curl -X 'POST' \
'http://localhost:8000/tasks/' \
-H 'Content-Type: application/json' \
-d '{
"title": "Buy groceries",
"description": "Milk, eggs, bread"
}'curl -X 'GET' \
'http://localhost:8000/tasks/' \
-H 'accept: application/json'curl -X 'GET' \
'http://localhost:8000/tasks/1' \
-H 'accept: application/json'curl -X 'PUT' \
'http://localhost:8000/tasks/1/complete' \
-H 'accept: application/json'curl -X 'DELETE' \
'http://localhost:8000/tasks/1' \
-H 'accept: application/json'