Automated Action db2997cc83 Create FastAPI todo backend with SQLite
Generated with and Co-Authored by [BackendIM](https://backend.im)
2025-05-11 16:39:38 +00:00

1.0 KiB

Todo Backend Service

A simple Todo API built with FastAPI and SQLite.

Features

  • Todo CRUD operations
  • RESTful API design
  • SQLite database with SQLAlchemy ORM
  • Alembic for database migrations

Requirements

Python 3.8+

Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Run database migrations:
alembic upgrade head

Running the Application

uvicorn main:app --reload

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

Swagger documentation is available at http://localhost:8000/docs

API Endpoints

Method URL Description
GET /api/v1/todos Get all todos
GET /api/v1/todos/{id} Get a todo by id
POST /api/v1/todos Create a new todo
PUT /api/v1/todos/{id} Update a todo
DELETE /api/v1/todos/{id} Delete a todo

Example JSON Payload for Creating a Todo

{
  "title": "Buy groceries",
  "description": "Milk, eggs, bread",
  "completed": false
}