Todo App API
A simple todo application API built with FastAPI and SQLite.
Features
- Create, read, update, and delete todo items
- Health check endpoint
- SQLite database with Alembic migrations
- Pydantic data validation
- Interactive API documentation
Project Structure
todoapp/
├── app/
│ ├── api/
│ │ ├── endpoints/
│ │ │ ├── health.py
│ │ │ └── todos.py
│ │ └── api.py
│ ├── core/
│ │ └── config.py
│ ├── crud/
│ │ └── todo.py
│ ├── db/
│ │ ├── deps.py
│ │ └── session.py
│ ├── models/
│ │ └── todo.py
│ └── schemas/
│ └── todo.py
├── migrations/
│ ├── versions/
│ │ └── a3bfb446d052_create_todos_table.py
│ ├── env.py
│ └── script.py.mako
├── alembic.ini
├── main.py
└── requirements.txt
Setup
-
Clone the repository
-
Install dependencies:
pip install -r requirements.txt
- Run the application:
uvicorn main:app --reload
API Documentation
Once the application is running, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
Todos
GET /api/v1/todos/
: Get all todosPOST /api/v1/todos/
: Create a new todoGET /api/v1/todos/{id}
: Get a specific todoPUT /api/v1/todos/{id}
: Update a todoDELETE /api/v1/todos/{id}
: Delete a todo
Health
GET /api/v1/health/
: Check API health status
Description
Languages
Python
95.9%
Mako
4.1%