
- Updated database path in database.py to use project root path - Updated alembic.ini to use correct database path - Modified alembic env.py to directly use database URL from code generated with BackendIM... (backend.im)
Simple Todo App
A simple todo application built with FastAPI and SQLite for managing todo items.
Features
- Add new todo items
- List all todo items
- Mark todo items as complete
- Delete todo items
- Health check endpoint
Project Structure
simpletodoapp/
├── alembic/ # Database migration files
├── app/ # Application code
│ ├── api/ # API endpoints
│ ├── database/ # Database connection and sessions
│ ├── models/ # SQLAlchemy models
│ ├── schemas/ # Pydantic schemas
│ └── storage/ # Database storage
├── main.py # Entry point
├── alembic.ini # Alembic configuration
└── requirements.txt # Dependencies
Installation
- Clone the repository:
git clone <repository-url>
cd simpletodoapp
- Install dependencies:
pip install -r requirements.txt
- 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 Endpoints
GET /health
- Health check endpointGET /todos
- List 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 todo
API Documentation
FastAPI automatically generates API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Description
Languages
Python
94.4%
Mako
5.6%