Automated Action 7a32d606f3 Create simple todo app with FastAPI and SQLite
- Setup project structure
- Create database models for todos
- Configure SQLite database connection
- Add Alembic migration scripts
- Implement CRUD API endpoints for todos
- Add health check endpoint
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-13 07:02:29 +00:00

Simple Todo App

A simple REST API for managing todos built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todos
  • SQLite database with SQLAlchemy ORM
  • Database migrations with Alembic
  • Health check endpoint
  • API documentation (Swagger UI and ReDoc)

Project Structure

simpletodoapp/
├── alembic/               # Database migration scripts
│   ├── versions/          # Migration version files
│   ├── env.py             # Alembic environment configuration
│   └── script.py.mako     # Migration script template
├── app/                   # Application package
│   ├── __init__.py        # Package initializer
│   ├── database.py        # Database session and engine setup
│   ├── models.py          # SQLAlchemy ORM models
│   └── schemas.py         # Pydantic schemas for request/response validation
├── alembic.ini            # Alembic configuration file
├── main.py                # Application entry point
├── README.md              # Project documentation
└── requirements.txt       # Project dependencies

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapp
  1. Install dependencies:
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 Endpoints

Health Check

GET /health

Returns the health status of the application.

Todos

GET /todos

Returns a list of all todos.

GET /todos/{todo_id}

Returns a specific todo by ID.

POST /todos

Creates a new todo.

Request Body:

{
  "title": "Buy groceries",
  "description": "Milk, eggs, bread",
  "completed": false
}
PUT /todos/{todo_id}

Updates an existing todo.

Request Body:

{
  "title": "Buy groceries",
  "description": "Milk, eggs, bread, cheese",
  "completed": true
}
DELETE /todos/{todo_id}

Deletes a todo by ID.

Description
Project: Simple Todo App
Readme 35 KiB
Languages
Python 94.3%
Mako 5.7%