
- Set up project structure and dependencies - Create Todo model with SQLAlchemy - Implement CRUD operations for todos - Create API endpoints for todos - Set up Alembic migrations - Update documentation generated with BackendIM... (backend.im)
1.1 KiB
1.1 KiB
Todo Application
This is a simple Todo application built with FastAPI and SQLite.
Features
- Create, read, update, and delete todos
- Filter todos by completion status
- Pagination support
API Endpoints
GET /todos
: List all todosPOST /todos
: Create a new todoGET /todos/{todo_id}
: Get a specific todoPUT /todos/{todo_id}
: Update a todoDELETE /todos/{todo_id}
: Delete a todoGET /health
: Health check endpoint
Running the Application
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
alembic upgrade head
-
Run the application:
uvicorn main:app --reload
-
Access the API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Project Structure
app/
: Main application packageapi/
: API endpointscrud/
: Database CRUD operationsdb/
: Database configurationmodels/
: SQLAlchemy modelsschemas/
: Pydantic schemas
alembic/
: Database migrationsmain.py
: Application entry pointrequirements.txt
: Project dependencies