Automated Action ae91c493c6 Add FastAPI todo application with SQLite database
- Implement CRUD operations for todos
- Add FastAPI with CORS middleware
- Set up SQLite database with Alembic migrations
- Include health endpoint and API documentation
- Configure Ruff for code linting
- Update README with comprehensive documentation
2025-06-17 07:03:02 +00:00
2025-06-17 06:58:21 +00:00

Todo API

A simple todo application built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todos
  • SQLite database with Alembic migrations
  • FastAPI with automatic API documentation
  • Health check endpoint
  • CORS enabled for all origins

Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. Run database migrations:
alembic upgrade head
  1. Start the application:
uvicorn main:app --host 0.0.0.0 --port 8000

API Endpoints

  • GET / - Root endpoint with API information
  • GET /health - Health check endpoint
  • GET /docs - Interactive API documentation
  • GET /redoc - Alternative API documentation
  • GET /openapi.json - OpenAPI specification

Todo Endpoints

  • POST /todos/ - Create a new todo
  • GET /todos/ - Get all todos (with pagination)
  • GET /todos/{todo_id} - Get a specific todo
  • PUT /todos/{todo_id} - Update a todo
  • DELETE /todos/{todo_id} - Delete a todo

Data Model

Todo items have the following fields:

  • id: Unique identifier (auto-generated)
  • title: Todo title (required)
  • description: Optional description
  • completed: Boolean completion status (default: false)
  • created_at: Creation timestamp
  • updated_at: Last update timestamp

Environment Variables

No environment variables are required for basic operation. The SQLite database is stored at /app/storage/db/db.sqlite.

Development

To run with auto-reload during development:

uvicorn main:app --reload --host 0.0.0.0 --port 8000

API Documentation

Once the server is running, you can access:

Description
Project: Todo App
Readme MIT 50 KiB
Languages
Python 93.9%
Mako 6.1%