Simple Todo App
A simple Todo API built with FastAPI and SQLite.
Features
- Create, read, update, and delete todo items
- Filter todos by completion status
- Health check endpoint for application status
- SQLite database with SQLAlchemy ORM
- API documentation with Swagger UI and ReDoc
Getting Started
Prerequisites
- Python 3.7+
- pip (Python package manager)
Installation
- Clone the repository:
git clone <repository-url>
cd simpletodoapp-ev72zr
- Install dependencies:
pip install -r requirements.txt
- Apply database migrations:
alembic upgrade head
- Start the development server:
uvicorn main:app --reload
The API will be available at http://localhost:8000
API Documentation
After starting the server, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
Todo Endpoints
-
GET /api/v1/todos: List all todos
- Query Parameters:
skip
: Number of records to skip (pagination)limit
: Maximum number of records to returncompleted
: Filter by completion status (true/false)
- Query Parameters:
-
POST /api/v1/todos: Create a new todo
- Request Body: JSON with todo details
-
GET /api/v1/todos/{todo_id}: Get a specific todo by ID
-
PUT /api/v1/todos/{todo_id}: Update a specific todo
- Request Body: JSON with updated todo details
-
DELETE /api/v1/todos/{todo_id}: Delete a specific todo
Health Endpoint
- GET /api/v1/health: Check the API health status
Project Structure
.
├── alembic.ini
├── app
│ ├── api
│ │ ├── endpoints
│ │ │ ├── health.py
│ │ │ └── todos.py
│ │ └── routes.py
│ ├── core
│ │ └── config.py
│ ├── db
│ │ ├── deps.py
│ │ └── session.py
│ ├── models
│ │ └── todo.py
│ └── schemas
│ └── todo.py
├── main.py
├── migrations
│ ├── README
│ ├── env.py
│ ├── script.py.mako
│ └── versions
│ └── 01_initial_setup.py
└── requirements.txt
License
This project is licensed under the MIT License.
Description
Languages
Python
95.1%
Mako
4.9%