Automated Action 168878cd6f Create Simple Todo Application with FastAPI and SQLite
- Set up project structure and dependencies
- Implement Todo model with SQLAlchemy
- Configure SQLite database connection
- Create Alembic migration scripts
- Implement RESTful API endpoints for CRUD operations
- Add health check endpoint
- Update README with documentation

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

Simple Todo Application

A simple Todo application API built with FastAPI and SQLite.

Features

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

Project Structure

├── alembic/              # Database migrations
├── app/                  # Application package
│   ├── api/              # API endpoints
│   ├── core/             # Core configuration
│   ├── crud/             # CRUD operations
│   ├── db/               # Database setup
│   ├── models/           # SQLAlchemy models
│   └── schemas/          # Pydantic schemas
├── alembic.ini           # Alembic configuration
├── main.py               # FastAPI application
└── requirements.txt      # Python dependencies

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/simpletodoapplication.git
cd simpletodoapplication
  1. Install dependencies:
pip install -r requirements.txt
  1. Run database migrations:
alembic upgrade head

Usage

Start the application:

uvicorn main:app --reload

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

API documentation is available at:

API Endpoints

Todo Endpoints

  • GET /todos - List 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

Health Check

  • GET /health - Check API health

Example Requests

Create a Todo

curl -X 'POST' \
  'http://localhost:8000/todos/' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "Buy groceries",
  "description": "Milk, eggs, bread",
  "completed": false
}'

List All Todos

curl -X 'GET' 'http://localhost:8000/todos/'

Update a Todo

curl -X 'PUT' \
  'http://localhost:8000/todos/1' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "Buy groceries",
  "description": "Milk, eggs, bread, cheese",
  "completed": true
}'
Description
Project: Simple Todo Application
Readme 37 KiB
Languages
Python 95.4%
Mako 4.6%