Simple Todo Application

A simple Todo API built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todo items
  • Filter todos by completion status
  • Database migrations using Alembic
  • Health check endpoint
  • API documentation

Requirements

  • Python 3.8+
  • FastAPI
  • SQLAlchemy
  • Alembic
  • Uvicorn
  • SQLite

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/simpletodoapplication.git
    cd simpletodoapplication
    
  2. Install the dependencies:

    pip install -r requirements.txt
    
  3. Run the database migrations:

    alembic upgrade head
    

Running the Application

Start the server with:

uvicorn main:app --reload

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

API Documentation

Once the application is running, you can access:

API Endpoints

Health Check

  • GET /health - Check the health of the API

Todo Operations

  • GET /api/v1/todos - List all todos (optional query parameters: skip, limit, completed)
  • POST /api/v1/todos - Create a new todo
  • GET /api/v1/todos/{todo_id} - Get a specific todo
  • PATCH /api/v1/todos/{todo_id} - Update a todo
  • DELETE /api/v1/todos/{todo_id} - Delete a todo

Project Structure

simpletodoapplication/
├── alembic.ini
├── app/
│   ├── api/
│   │   ├── endpoints/
│   │   │   ├── health.py
│   │   │   └── todos.py
│   │   └── routers.py
│   ├── core/
│   │   └── config.py
│   ├── db/
│   │   └── session.py
│   ├── models/
│   │   └── todo.py
│   └── schemas/
│       └── todo.py
├── main.py
├── migrations/
│   ├── env.py
│   ├── script.py.mako
│   └── versions/
│       └── 01_initial_migration.py
└── requirements.txt

Data Models

Todo

  • id: Integer (Primary Key)
  • title: String (Required)
  • description: String (Optional)
  • completed: Boolean (Default: False)
  • created_at: DateTime
  • updated_at: DateTime
Description
Project: Simple Todo Application
Readme 39 KiB
Languages
Python 95.2%
Mako 4.8%