
Generated with BackendIM... (backend.im)
FastAPI Todo API
This is a simple Todo API built with FastAPI and SQLite.
Features
- Create, read, update, and delete todos
- SQLite database with SQLAlchemy ORM
- Alembic for database migrations
- Health check endpoint
Project Structure
.
├── alembic/ # Database migration files
├── app/ # Application code
│ ├── api/ # API endpoints
│ ├── core/ # Core functionality and config
│ ├── crud/ # CRUD operations
│ ├── db/ # Database setup
│ ├── models/ # SQLAlchemy models
│ └── schemas/ # Pydantic schemas
├── alembic.ini # Alembic configuration
├── main.py # Application entry point
└── requirements.txt # Project dependencies
Getting Started
- Clone the repository
- Install the dependencies:
pip install -r requirements.txt
- Run the migrations:
alembic upgrade head
- Start the server:
uvicorn main:app --reload
API Documentation
Once the server is running, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
GET /api/v1/todos/
: Get all todosPOST /api/v1/todos/
: Create a new todoGET /api/v1/todos/{todo_id}
: Get a specific todo by IDPUT /api/v1/todos/{todo_id}
: Update a specific todoDELETE /api/v1/todos/{todo_id}
: Delete a specific todoGET /health
: Health check endpoint
Description
Languages
Python
95.2%
Mako
4.8%