
- Move wildcard import from app.db.all_models to module level - Fix SyntaxError that was preventing application startup - Ensure all models are registered with SQLAlchemy Base
Todo API
This is a FastAPI Todo API application that allows you to manage todo items.
Features
- Create, read, update, and delete todo items
- Filter todos by completion status and title
- Pagination support
- SQLite database backend
- Alembic migrations
Requirements
- Python 3.9+
- FastAPI
- SQLAlchemy
- Alembic
- Uvicorn
- Other dependencies in requirements.txt
Installation
- Clone the repository
- Install the dependencies:
pip install -r requirements.txt
Database Setup
The application uses SQLite as the database backend. The database will be automatically created in the /app/storage/db
directory when the application starts.
To run the 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
The API documentation is available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
GET /api/v1/todos
: List all todos with optional filteringPOST /api/v1/todos
: Create a new todoGET /api/v1/todos/{todo_id}
: Get a specific todoPUT /api/v1/todos/{todo_id}
: Update a todoDELETE /api/v1/todos/{todo_id}
: Delete a todo
Health Check
The application includes a health check endpoint at /health
that can be used to verify that the service is running properly.
Description
Languages
Python
97%
Mako
3%