
- Created FastAPI application structure - Added Todo model and CRUD operations - Added database integration with SQLAlchemy - Added migrations with Alembic - Added health endpoint - Added API documentation with Swagger UI and ReDoc
SimpleTodoApp API
A FastAPI-based backend for a simple Todo application with SQLite database.
Features
- Create, read, update, and delete Todo items
- Health check endpoint
- SQLite database with SQLAlchemy ORM
- Database migrations with Alembic
- Comprehensive API documentation with Swagger UI and ReDoc
Project Structure
simpletodoapp/
├── api/ # API-related code
│ ├── crud/ # CRUD operations
│ ├── routers/ # API endpoints
│ └── schemas/ # Pydantic models for request/response validation
├── db/ # Database-related code
│ ├── database.py # Database connection and session
│ └── models.py # SQLAlchemy models
├── migrations/ # Alembic migrations
├── alembic.ini # Alembic configuration
├── main.py # FastAPI application entry point
└── requirements.txt # Project dependencies
Installation & Setup
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
- Run the application:
uvicorn main:app --reload
API Documentation
Once the server is running, you can access:
- Swagger UI documentation at
/docs
- ReDoc documentation at
/redoc
API Endpoints
GET /health
- Health check endpointGET /api/todos
- List all todosGET /api/todos/{id}
- Get a single todo by IDPOST /api/todos
- Create a new todoPATCH /api/todos/{id}
- Update a todo (partial update)DELETE /api/todos/{id}
- Delete a todo
Description
Languages
Python
98.4%
Mako
1.6%