A clean and structured RESTful To-Do List API built with FastAPI and SQLAlchemy using Clean Architecture principles.
- Python 3.13+
- FastAPI
- SQLAlchemy
- SQLite
- Pydantic
- Uvicorn
app/ │── main.py
│── database.py
├── models/
├── schemas/
├── repository/
└── service/
This project follows a simplified Clean Architecture approach:
- Service Layer → Contains business logic
- Repository Layer → Manages database operations
- Models → SQLAlchemy ORM models
- Schemas → Pydantic validation models
- Create a new task
- Retrieve all tasks
- Update task status
- Input validation using Pydantic
- Business rule validation (duplicate prevention)
- Dependency Injection using FastAPI
Returns all tasks.
Creates a new task.
Body: { "task": "Learn FastAPI" }
Updates task status.
Body: { "id":1, "is_done": true }
pip install -r requirements.txt
uvicorn main:app --reload
Open: http://127.0.0.1:8000/docs