Automated Action 959ebdf9a5 Create simple Todo API application with FastAPI and SQLite
generated with BackendIM... (backend.im)
2025-05-12 23:20:38 +00:00

1.4 KiB

Todo API Application

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

Features

  • Create, Read, Update, and Delete todos
  • Health endpoint for monitoring application status
  • SQLite database for data persistence
  • Alembic for database migrations

Project Structure

simpletodoapplication/
├── app/
│   ├── __init__.py
│   ├── database.py
│   ├── models.py
│   └── schemas.py
├── migrations/
│   ├── versions/
│   │   └── 001_create_todos_table.py
│   ├── env.py
│   ├── README
│   └── script.py.mako
├── alembic.ini
├── main.py
└── requirements.txt

API Endpoints

  • GET /health - Check API health
  • GET /todos - Get all todos
  • POST /todos - Create a new todo
  • GET /todos/{todo_id} - Get a specific todo
  • PUT /todos/{todo_id} - Update a todo
  • DELETE /todos/{todo_id} - Delete a todo

Requirements

  • Python 3.8+
  • Dependencies listed in requirements.txt

Installation and Setup

  1. Clone the repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run database migrations:
    alembic upgrade head
    
  4. Start the server:
    uvicorn main:app --reload
    

API Documentation

Once the application is running, you can access:

  • Swagger UI documentation at /docs
  • ReDoc documentation at /redoc