Automated Action e800953688 Fix API endpoint routing for tasks
- Directly import tasks endpoints in main.py for more explicit routing
- Create API v1 router in main.py instead of using a separate module
- Simplify routing structure to ensure endpoints are accessible
2025-06-10 15:46:55 +00:00
2025-06-10 14:48:01 +00:00
2025-06-10 14:39:16 +00:00
2025-06-10 14:48:01 +00:00
2025-06-10 15:46:55 +00:00
2025-06-10 14:48:01 +00:00
2025-06-10 14:48:01 +00:00
2025-06-10 14:48:01 +00:00

Task Manager API

A RESTful API for managing tasks, built with FastAPI and SQLite.

Features

  • Create, read, update, and delete tasks
  • Filter tasks by title, priority, and completion status
  • Pagination support
  • Health check endpoint
  • SQLite database with SQLAlchemy ORM
  • Alembic for database migrations
  • Comprehensive API documentation with Swagger UI

Getting Started

Prerequisites

  • Python 3.8+
  • pip

Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Run database migrations:
alembic upgrade head
  1. Start the application:
uvicorn main:app --reload

API Endpoints

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

  • API Documentation: http://localhost:8000/docs or http://localhost:8000/redoc
  • OpenAPI Schema: http://localhost:8000/openapi.json
  • Health Check: http://localhost:8000/health

Tasks Endpoints

  • GET /api/v1/tasks: List all tasks (with optional filtering)
  • POST /api/v1/tasks: Create a new task
  • GET /api/v1/tasks/{task_id}: Get a specific task
  • PUT /api/v1/tasks/{task_id}: Update a task
  • DELETE /api/v1/tasks/{task_id}: Delete a task

Query Parameters for Filtering Tasks

  • skip: Number of tasks to skip (pagination)
  • limit: Maximum number of tasks to return (pagination)
  • title: Filter by title (partial match)
  • priority: Filter by priority (1=Low, 2=Medium, 3=High)
  • completed: Filter by completion status (true/false)

Task Data Model

  • id: Unique identifier
  • title: Task title (required)
  • description: Task description (optional)
  • completed: Completion status (default: false)
  • priority: Priority level (1=Low, 2=Medium, 3=High, default: 1)
  • due_date: Due date (optional)
  • created_at: Creation timestamp
  • updated_at: Last update timestamp

Development

Project Structure

.
├── alembic.ini             # Alembic configuration file
├── main.py                 # FastAPI application entry point
├── README.md               # Project documentation
├── requirements.txt        # Project dependencies
├── app/                    # Application package
│   ├── api/                # API endpoints
│   │   └── v1/             # API version 1
│   │       └── endpoints/  # API endpoints modules
│   ├── core/               # Core application modules
│   ├── crud/               # CRUD operations
│   ├── db/                 # Database setup and session
│   ├── models/             # SQLAlchemy models
│   └── schemas/            # Pydantic schemas
└── migrations/             # Alembic migrations
    └── versions/           # Migration versions

Database Migrations

To create a new migration after model changes:

alembic revision --autogenerate -m "description"

To apply migrations:

alembic upgrade head

License

This project is licensed under the MIT License.

Description
Project: Task Manager API
Readme 47 KiB
Languages
Python 97%
Mako 3%