Simple Todo App

A simple Todo application API built with FastAPI and SQLite.

Features

  • Create, read, update, and delete Todo items
  • Automatically track creation and update timestamps
  • Health check endpoint
  • Database migrations with Alembic
  • API documentation with Swagger UI and ReDoc

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapp-cstnbs
  1. Install dependencies:
pip install -r requirements.txt
  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:

API Endpoints

Todo Endpoints

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

Health Check

  • GET /health: Check the health status of the application

Project Structure

simpletodoapp-cstnbs/
├── app/
│   ├── api/
│   │   └── routes.py          # API route definitions
│   ├── core/
│   │   └── config.py          # Application configuration
│   ├── db/
│   │   └── database.py        # Database connection setup
│   ├── models/
│   │   └── todo.py            # SQLAlchemy models
│   ├── schemas/
│   │   └── todo.py            # Pydantic schemas for API
│   └── storage/
│       └── db/                # SQLite database storage
├── migrations/                # Alembic migrations
│   ├── versions/
│   │   └── *.py               # Migration scripts
│   ├── env.py                 # Alembic environment
│   └── script.py.mako         # Migration script template
├── alembic.ini                # Alembic configuration
├── main.py                    # Application entry point
├── requirements.txt           # Project dependencies
└── README.md                  # This file

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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