Automated Action f55cad6274 Create Todo application with FastAPI
- Set up project structure with FastAPI
- Implement Todo model and database connection
- Set up Alembic for database migrations
- Create CRUD API endpoints for Todo management
- Add health endpoint for application monitoring
- Update README with project documentation

generated with BackendIM... (backend.im)
2025-05-14 01:20:30 +00:00

1.4 KiB

Todo Application

A simple Todo application built with FastAPI and SQLite.

Features

  • Create, read, update, and delete todos
  • Filter todos by completion status
  • Health endpoint for application monitoring

Project Structure

/
├── app/
│   ├── api/
│   │   ├── endpoints/
│   │   │   ├── health.py  # Health check endpoint
│   │   │   └── todos.py   # Todo CRUD operations
│   ├── db/
│   │   ├── base.py        # SQLAlchemy Base
│   │   └── session.py     # Database session management
│   ├── models/
│   │   └── todo.py        # SQLAlchemy Todo model
│   └── schemas/
│       └── todo.py        # Pydantic schemas for Todo
├── alembic/               # Database migrations
├── main.py                # FastAPI application
└── requirements.txt       # Project dependencies

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Run migrations:
alembic upgrade head
  1. Start the application:
uvicorn main:app --reload

API Endpoints

Todos

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

Health

  • GET /health: Check application health

API Documentation

  • Swagger UI: /docs
  • ReDoc: /redoc