Automated Action 5e499461d7 Create simple FastAPI Todo application
- Set up project structure with FastAPI
- Create Todo model with SQLAlchemy
- Set up Alembic for database migrations
- Implement CRUD operations for todos
- Add health endpoint
- Update README with setup and usage instructions

generated with BackendIM... (backend.im)
2025-05-13 05:00:15 +00:00

1.8 KiB

Simple Todo Application

A RESTful API for managing todo items built with FastAPI and SQLAlchemy.

Features

  • Create, read, update, and delete todo items
  • Database migrations with Alembic
  • SQLite database
  • Health check endpoint

Project Structure

.
├── alembic.ini
├── app
│   ├── api
│   │   ├── endpoints
│   │   │   └── todos.py
│   │   └── routes.py
│   ├── core
│   │   └── config.py
│   ├── crud
│   │   └── todo.py
│   ├── db
│   │   └── session.py
│   ├── models
│   │   └── todo.py
│   └── schemas
│       └── todo.py
├── main.py
├── migrations
│   ├── env.py
│   ├── script.py.mako
│   └── versions
│       └── 001_create_todos_table.py
└── requirements.txt

Installation

  1. Clone the repository:
git clone <repository-url>
cd simpletodoapplication
  1. Install dependencies:
pip install -r requirements.txt

Running the Application

Start the application using Uvicorn:

uvicorn main:app --reload

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

API documentation is automatically generated and available at:

API Endpoints

  • GET /health - Health check endpoint
  • GET /api/v1/todos - List all todos
  • 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

To apply migrations:

alembic upgrade head

This is a FastAPI application bootstrapped by BackendIM, the AI-powered backend generation platform.