Simple Todo App

This is a simple Todo API application built with FastAPI and SQLite.

Features

  • Create, Read, Update, and Delete Todo items
  • Health check endpoint
  • Database migrations using Alembic
  • SQLite database for data storage

Project Structure

.
├── alembic/             # Database migration files
├── app/                 # Application package
│   ├── database/        # Database configuration and session management
│   ├── models/          # SQLAlchemy ORM models
│   ├── routers/         # API route handlers
│   └── schemas/         # Pydantic models for request/response validation
├── alembic.ini          # Alembic configuration
├── main.py              # Application entry point
└── requirements.txt     # Project dependencies

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapp
  1. Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Database Setup

  1. Run database migrations:
alembic upgrade head

Running the Application

Start the application with Uvicorn:

uvicorn main:app --reload

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

API Documentation

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

API Endpoints

Health Check

  • GET /health: Check the application health status

Todo Endpoints

  • GET /todos: List all todos
  • POST /todos: Create a new todo
  • GET /todos/{todo_id}: Get a specific todo by ID
  • PATCH /todos/{todo_id}: Update a specific todo
  • DELETE /todos/{todo_id}: Delete a specific todo
Description
Project: Simple Todo App
Readme 41 KiB
Languages
Python 95.1%
Mako 4.9%