todoapp-mr40bu/README.md
2025-06-19 22:46:52 +00:00

1.3 KiB

Todo App API

A simple FastAPI-based Todo application with SQLite database.

Features

  • Create, read, update, and delete todos
  • SQLite database with SQLAlchemy ORM
  • Database migrations with Alembic
  • CORS enabled for all origins
  • Health check endpoint
  • Interactive API documentation

API Endpoints

  • GET / - Root endpoint with app information
  • GET /health - Health check endpoint
  • GET /todos/ - Get all todos (with pagination)
  • 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

Documentation

  • API documentation: /docs
  • Alternative documentation: /redoc
  • OpenAPI schema: /openapi.json

Setup and Running

  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Run the application:

    uvicorn main:app --reload
    

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

Database

The application uses SQLite database stored at /app/storage/db/db.sqlite.

Todo Schema

  • id: Integer (auto-generated)
  • title: String (required)
  • description: String (optional)
  • completed: Boolean (default: false)
  • created_at: DateTime (auto-generated)
  • updated_at: DateTime (auto-updated)