Simple Todo App

A simple todo application built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todo items
  • Filter todos by completion status
  • Health check endpoint
  • Database migrations with Alembic
  • CORS enabled for all origins

Project Structure

.
├── alembic.ini
├── app
│   ├── api
│   │   ├── health.py
│   │   └── todos.py
│   ├── database
│   │   └── config.py
│   ├── models
│   │   └── todo.py
│   └── schemas
│       └── todo.py
├── main.py
├── migrations
│   ├── env.py
│   ├── script.py.mako
│   └── versions
│       └── initial_migration.py
├── pyproject.toml
├── README.md
└── requirements.txt

Getting Started

Prerequisites

  • Python 3.8 or higher

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapp
  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 --reload

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

API Documentation

Once the application is running, you can access the API documentation at:

API Endpoints

Todo Endpoints

  • GET /api/v1/todos - Get all todos (with optional filtering)
  • 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

Health Endpoint

  • GET /health - Check application health

Environment Variables

The application uses the following environment variables:

  • None required for basic setup (SQLite database is stored in /app/storage/db/db.sqlite)

License

MIT

Description
Project: Simple Todo App
Readme 39 KiB
Languages
Python 94.8%
Mako 5.2%