Task Management API

A simple task management API built with FastAPI and SQLite.

Features

  • Create, read, update, and delete tasks
  • Mark tasks as completed
  • Filter tasks by completion status and priority
  • Set due dates for tasks
  • Health check endpoint

Tech Stack

  • Python 3.9+
  • FastAPI for API development
  • SQLAlchemy for ORM
  • Alembic for database migrations
  • SQLite for database storage
  • Pydantic for data validation
  • Uvicorn for ASGI server

Project Structure

.
├── app/                        # Application package
│   ├── api/                    # API endpoints
│   │   └── routes/             # API route definitions
│   ├── core/                   # Core configuration
│   ├── db/                     # Database configurations
│   ├── models/                 # SQLAlchemy models
│   └── schemas/                # Pydantic schemas
├── migrations/                 # Alembic migration scripts
├── alembic.ini                 # Alembic configuration
├── main.py                     # Entry point for the application
└── requirements.txt            # Dependencies

Getting Started

Prerequisites

  • Python 3.9+
  • SQLite

Installation

  1. Clone the repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run the application:
    uvicorn main:app --reload
    

API Documentation

Once the application is running, you can access the API documentation at:

API Endpoints

Health Check

  • GET /health - Check if the API is running

Task Management

  • GET /api/tasks - List all tasks
  • POST /api/tasks - Create a new task
  • GET /api/tasks/{task_id} - Get a specific task
  • PUT /api/tasks/{task_id} - Update a task
  • DELETE /api/tasks/{task_id} - Delete a task
  • POST /api/tasks/{task_id}/complete - Mark a task as completed

Task Model

  • id: Unique identifier
  • title: Title of the task
  • description: Optional description
  • is_completed: Task completion status
  • priority: Task priority (1=Low, 2=Medium, 3=High)
  • created_at: Creation timestamp
  • updated_at: Last update timestamp
  • completed_at: Completion timestamp (if completed)
  • due_date: Optional due date
Description
Project: Task Management API
Readme 39 KiB
Languages
Python 96.3%
Mako 3.7%