
- Add User model with email-based authentication - Add Tag model with many-to-many relationship to todos - Add TodoTag junction table for todo-tag relationships - Enhance Todo model with priority levels (low, medium, high) - Add due_date field with datetime support - Add recurrence_pattern field for recurring todos - Add parent-child relationship for subtasks support - Create comprehensive alembic migration for all changes - Add proper indexes for performance optimization - Use Text type for todo descriptions - Implement proper SQLAlchemy relationships and foreign keys
Todo App Backend
A simple todo application backend built with FastAPI and SQLite.
Features
- Create, read, update, and delete todos
- RESTful API endpoints
- SQLite database with SQLAlchemy ORM
- Database migrations with Alembic
- Automatic API documentation with Swagger UI
- CORS support for cross-origin requests
API Endpoints
GET /
- Root endpoint with API informationGET /health
- Health check endpointPOST /todos/
- Create a new todoGET /todos/
- Get all todos (with pagination)GET /todos/{todo_id}
- Get a specific todoPUT /todos/{todo_id}
- Update a todoDELETE /todos/{todo_id}
- Delete a todo
Installation
- Install dependencies:
pip install -r requirements.txt
- The application will automatically create the database tables when started.
Usage
Start the application:
uvicorn main:app --reload
The API will be available at:
- Main API: http://localhost:8000
- Documentation: http://localhost:8000/docs
- Alternative docs: http://localhost:8000/redoc
Database
The application uses SQLite database stored at /app/storage/db/db.sqlite
. The database schema is managed with Alembic migrations.
Todo Schema
Each todo has the following fields:
id
: Unique identifiertitle
: Todo title (required)description
: Optional descriptioncompleted
: Boolean status (default: false)created_at
: Creation timestampupdated_at
: Last update timestamp
Description
Languages
Python
97.7%
Mako
2.3%