Simple Todo App

A simple Todo API built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todo items
  • Filter todos by completion status
  • Health check endpoint for application status
  • SQLite database with SQLAlchemy ORM
  • API documentation with Swagger UI and ReDoc

Getting Started

Prerequisites

  • Python 3.7+
  • pip (Python package manager)

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapp-ev72zr
  1. Install dependencies:
pip install -r requirements.txt
  1. Apply database migrations:
alembic upgrade head
  1. Start the development server:
uvicorn main:app --reload

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

API Documentation

After starting the server, you can access the API documentation at:

API Endpoints

Todo Endpoints

  • GET /api/v1/todos: List all todos

    • Query Parameters:
      • skip: Number of records to skip (pagination)
      • limit: Maximum number of records to return
      • completed: Filter by completion status (true/false)
  • POST /api/v1/todos: Create a new todo

    • Request Body: JSON with todo details
  • GET /api/v1/todos/{todo_id}: Get a specific todo by ID

  • PUT /api/v1/todos/{todo_id}: Update a specific todo

    • Request Body: JSON with updated todo details
  • DELETE /api/v1/todos/{todo_id}: Delete a specific todo

Health Endpoint

  • GET /api/v1/health: Check the API health status

Project Structure

.
├── alembic.ini
├── app
│   ├── api
│   │   ├── endpoints
│   │   │   ├── health.py
│   │   │   └── todos.py
│   │   └── routes.py
│   ├── core
│   │   └── config.py
│   ├── db
│   │   ├── deps.py
│   │   └── session.py
│   ├── models
│   │   └── todo.py
│   └── schemas
│       └── todo.py
├── main.py
├── migrations
│   ├── README
│   ├── env.py
│   ├── script.py.mako
│   └── versions
│       └── 01_initial_setup.py
└── requirements.txt

License

This project is licensed under the MIT License.

Description
Project: Simple Todo App
Readme 37 KiB
Languages
Python 95.1%
Mako 4.9%