Task Management API
This is a simple REST API for managing tasks built with FastAPI and SQLite.
Features
- Create, read, update, and delete tasks
- Filter tasks by status, priority, and completion status
- Health check endpoint
- OpenAPI documentation
- CORS enabled
Tech Stack
- FastAPI: Modern, fast web framework for building APIs
- SQLAlchemy: SQL toolkit and ORM
- Alembic: Database migration tool
- SQLite: Lightweight disk-based database
- Pydantic: Data validation and settings management
- Uvicorn: ASGI server
API Endpoints
GET /
: Root endpoint with API informationGET /openapi.json
: OpenAPI schemaGET /docs
: Swagger UI documentationGET /redoc
: ReDoc documentationGET /api/v1/health
: Health check endpoint
Task Endpoints
GET /api/v1/tasks
: List all tasksPOST /api/v1/tasks
: Create a new taskGET /api/v1/tasks/{task_id}
: Get a task by IDPUT /api/v1/tasks/{task_id}
: Update a taskDELETE /api/v1/tasks/{task_id}
: Delete a task
Setup and Installation
Prerequisites
- Python 3.8 or higher
Installation
-
Clone the repository:
git clone <repository-url> cd taskmanagementapi
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
uvicorn main:app --reload
-
The API will be available at
http://localhost:8000
Database Migrations
The application uses Alembic for database migrations. Migrations are automatically applied when the application starts. If you need to run migrations manually:
alembic upgrade head
Environment Variables
The application uses the following environment variables:
- None required as it uses SQLite with a fixed path
Development
Running Tests
Currently, no tests are implemented.
Linting
The project uses Ruff for linting:
ruff check .
API Documentation
When the application is running, you can access the Swagger UI documentation at http://localhost:8000/docs
and the ReDoc documentation at http://localhost:8000/redoc
.
Description
Languages
Python
96%
Mako
4%