Simple Todo App

A simple Todo application built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todo items
  • RESTful API with JSON responses
  • SQLite database with SQLAlchemy ORM
  • Alembic for database migrations
  • API documentation with Swagger UI and ReDoc

Project Structure

.
├── alembic.ini
├── app
│   ├── api
│   │   ├── endpoints
│   │   │   ├── health.py
│   │   │   └── todos.py
│   │   └── router.py
│   ├── core
│   │   └── config.py
│   ├── database
│   │   ├── base.py
│   │   └── deps.py
│   ├── models
│   │   └── todo.py
│   ├── schemas
│   │   └── todo.py
│   └── services
│       └── todo_service.py
├── main.py
├── migrations
│   ├── env.py
│   ├── README
│   ├── script.py.mako
│   └── versions
│       └── 001_create_todos_table.py
└── requirements.txt

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapp
  1. Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`
pip install -r requirements.txt
  1. Run the application:
uvicorn main:app --reload

The application will be available at http://localhost:8000.

API Documentation

API documentation is available at:

API Endpoints

Health Check

  • GET /health - Check API health status

Todos

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

The application uses Alembic for database migrations:

  1. Run migrations:
alembic upgrade head
  1. Create a new migration:
alembic revision -m "your migration message"

License

MIT

Description
Project: Simple Todo App
Readme 38 KiB
Languages
Python 95.6%
Mako 4.4%