
- Setup FastAPI project structure - Create SQLAlchemy models and database connection - Implement Alembic migrations - Create CRUD operations for todos - Add API endpoints for todos - Add health endpoint - Update README.md generated with BackendIM... (backend.im)
Simple Todo App
A simple Todo API built with FastAPI and SQLite.
Features
- RESTful API for managing todo items
- SQLite database for data storage
- Alembic migrations
- CRUD operations for todos
Project Structure
.
├── alembic/ # Database migrations
│ └── versions/ # Migration scripts
├── app/ # Application package
│ ├── api/ # API endpoints
│ ├── core/ # Core components
│ ├── crud/ # CRUD operations
│ ├── db/ # Database components
│ ├── models/ # SQLAlchemy models
│ └── schemas/ # Pydantic schemas
├── alembic.ini # Alembic configuration
├── main.py # Application entry point
└── requirements.txt # Dependencies
API Endpoints
GET /api/v1/todos
- List all todosPOST /api/v1/todos
- Create a new todoGET /api/v1/todos/{todo_id}
- Get a specific todoPUT /api/v1/todos/{todo_id}
- Update a todoDELETE /api/v1/todos/{todo_id}
- Delete a todoGET /health
- Health check endpoint
Getting Started
Prerequisites
- Python 3.8+
- pip
Installation
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Run database migrations:
alembic upgrade head
- Start the application:
uvicorn main:app --reload
API Documentation
Once the application is running, you can access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Description
Languages
Python
95.5%
Mako
4.5%