
- Set up project structure with FastAPI app - Create SQLite database models with SQLAlchemy - Set up Alembic migrations - Implement CRUD endpoints for todo items - Add health check endpoint - Update README with setup instructions generated with BackendIM... (backend.im)
Simple Todo App with FastAPI and SQLite
A minimalist Todo API application built with FastAPI and SQLite for managing todo items.
Features
- Create, read, update, and delete todo items
- SQLite database with SQLAlchemy ORM
- Alembic migrations for database versioning
- Health check endpoint for monitoring
- OpenAPI documentation
Prerequisites
- Python 3.8+
- pip (Python package installer)
Installation
- Clone the repository:
git clone https://github.com/yourusername/simpletodoapp.git
cd simpletodoapp
- Install dependencies:
pip install -r requirements.txt
- Prepare the database directory:
mkdir -p /app/storage/db
- Run database migrations:
alembic upgrade head
Running the Application
Start the application with Uvicorn:
uvicorn main:app --reload
The API will be available at http://localhost:8000
API Documentation
Once the application is running, you can access:
- Interactive API documentation: http://localhost:8000/docs
- Alternative API documentation: http://localhost:8000/redoc
API Endpoints
GET /todos
- Get all todosPOST /todos
- Create a new todoGET /todos/{todo_id}
- Get a specific todoPATCH /todos/{todo_id}
- Update a todoDELETE /todos/{todo_id}
- Delete a todoGET /health
- Check application health
Example Todo JSON
{
"title": "Buy groceries",
"description": "Milk, eggs, bread, and cheese",
"completed": false
}
Description
Languages
Python
94.4%
Mako
5.6%