
- Added environment variable support via .env file - Updated API routes with versioning prefix - Improved documentation in README - Enhanced SQLite database path configuration generated with BackendIM... (backend.im)
Simple Todo App
A simple Todo application built with FastAPI and SQLite.
Features
- Create, read, update, and delete todo items
- Filter todos by completion status
- RESTful API with OpenAPI documentation
- SQLite database with SQLAlchemy ORM
- Alembic for database migrations
- Environment variable configuration support
Project Structure
.
├── alembic/ # Database migration scripts
├── app/ # Application code
│ ├── api/ # API endpoints
│ │ ├── v1/ # API version 1
│ │ │ └── endpoints/ # API endpoints
│ ├── core/ # Core application code
│ ├── crud/ # CRUD operations
│ ├── db/ # Database setup
│ ├── models/ # SQLAlchemy models
│ └── schemas/ # Pydantic schemas
├── main.py # Application entry point
├── alembic.ini # Alembic configuration
└── requirements.txt # Dependencies
Installation
- Clone the repository:
git clone https://github.com/yourusername/simpletodoapp.git
cd simpletodoapp
- Install dependencies:
pip install -r requirements.txt
-
Configure environment variables (optional): Create a
.env
file with your configuration options -
Run database migrations:
alembic upgrade head
Usage
- Start the server:
uvicorn main:app --reload
- Access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
All API endpoints are prefixed with /api/v1
GET /api/v1/todos
: Get all todosGET /api/v1/todos/{id}
: Get a specific todoPOST /api/v1/todos
: Create a new todoPUT /api/v1/todos/{id}
: Update a todoDELETE /api/v1/todos/{id}
: Delete a todo
Health Check
GET /health
: Health check endpoint
License
MIT
Description
Languages
Python
95.8%
Mako
4.2%