
- Set up project structure with FastAPI - Implement Todo model and database connection - Set up Alembic for database migrations - Create CRUD API endpoints for Todo management - Add health endpoint for application monitoring - Update README with project documentation generated with BackendIM... (backend.im)
Todo Application
A simple Todo application built with FastAPI and SQLite.
Features
- Create, read, update, and delete todos
- Filter todos by completion status
- Health endpoint for application monitoring
Project Structure
/
├── app/
│ ├── api/
│ │ ├── endpoints/
│ │ │ ├── health.py # Health check endpoint
│ │ │ └── todos.py # Todo CRUD operations
│ ├── db/
│ │ ├── base.py # SQLAlchemy Base
│ │ └── session.py # Database session management
│ ├── models/
│ │ └── todo.py # SQLAlchemy Todo model
│ └── schemas/
│ └── todo.py # Pydantic schemas for Todo
├── alembic/ # Database migrations
├── main.py # FastAPI application
└── requirements.txt # Project dependencies
Setup
- Install dependencies:
pip install -r requirements.txt
- Run migrations:
alembic upgrade head
- Start the application:
uvicorn main:app --reload
API Endpoints
Todos
GET /api/todos
: List all todosPOST /api/todos
: Create a new todoGET /api/todos/{todo_id}
: Get a specific todoPUT /api/todos/{todo_id}
: Update a todoDELETE /api/todos/{todo_id}
: Delete a todo
Health
GET /health
: Check application health
API Documentation
- Swagger UI:
/docs
- ReDoc:
/redoc
Description
Languages
Python
95.7%
Mako
4.3%