Simple Todo Application

A simple Todo API built with FastAPI and SQLite.

Features

  • Create, Read, Update, and Delete Todo items
  • SQLite database with SQLAlchemy ORM
  • Database migrations with Alembic
  • API documentation with Swagger UI and ReDoc
  • Health check endpoint

Project Structure

/
├── app/                    # Main application package
│   ├── api/                # API endpoints
│   │   ├── health.py       # Health check endpoint
│   │   ├── schemas.py      # Pydantic models
│   │   └── todos.py        # Todo CRUD endpoints
│   ├── database/           # Database configuration
│   │   └── config.py       # SQLAlchemy setup
│   └── models/             # SQLAlchemy models
│       └── todo.py         # Todo model
├── migrations/             # Alembic migrations
│   └── versions/           # Migration scripts
├── alembic.ini             # Alembic configuration
├── main.py                 # Application entry point
└── requirements.txt        # Python dependencies

API Endpoints

  • GET /api/todos: Get all todo items
  • POST /api/todos: Create a new todo item
  • GET /api/todos/{todo_id}: Get a specific todo item
  • PUT /api/todos/{todo_id}: Update a todo item
  • DELETE /api/todos/{todo_id}: Delete a todo item
  • GET /health: Check application health

Getting Started

Prerequisites

  • Python 3.8 or higher

Installation

  1. Clone the repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run the application:
    uvicorn main:app --reload
    

API Documentation

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

Database

The application uses SQLite as the database with SQLAlchemy ORM. The database file is stored at /app/storage/db/db.sqlite.

Description
Project: Simple Todo Application
Readme 40 KiB
Languages
Python 95.2%
Mako 4.8%