Simple Todo Application

A simple todo application API built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todo items
  • Built with FastAPI for high performance
  • SQLite database with SQLAlchemy ORM
  • Alembic for database migrations
  • Health check endpoint

Requirements

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

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapplication-ti5xsx
  1. Install dependencies:
pip install -r requirements.txt

Usage

  1. Run the API server:
python main.py

Or with uvicorn directly:

uvicorn main:app --reload
  1. Access the API documentation:

API Endpoints

Health Check

  • GET /health - Check if the API is running

Todo Endpoints

  • GET /api/v1/todos/ - Get all todos
  • POST /api/v1/todos/ - Create a new todo
  • GET /api/v1/todos/{todo_id} - Get a specific todo
  • PUT /api/v1/todos/{todo_id} - Update a todo
  • DELETE /api/v1/todos/{todo_id} - Delete a todo

Database Migrations

This project uses Alembic for database migrations:

# Apply migrations
alembic upgrade head

# Create a new migration after model changes
alembic revision --autogenerate -m "Description of changes"

Project Structure

simpletodoapplication-ti5xsx/
├── alembic.ini
├── app/
│   ├── __init__.py
│   ├── api/
│   │   ├── __init__.py
│   │   └── routes.py
│   ├── db/
│   │   ├── __init__.py
│   │   ├── database.py
│   │   └── models.py
│   └── schemas/
│       ├── __init__.py
│       └── todo.py
├── main.py
├── migrations/
│   ├── env.py
│   ├── script.py.mako
│   └── versions/
│       └── 47fb0c1c35a0_initial_migration.py
└── requirements.txt
Description
Project: Simple Todo Application
Readme 36 KiB
Languages
Python 94.3%
Mako 5.7%