
- Set up project structure with FastAPI - Create Todo model with SQLAlchemy - Set up Alembic for database migrations - Implement CRUD operations for todos - Add health endpoint - Update README with setup and usage instructions generated with BackendIM... (backend.im)
Simple Todo Application
A RESTful API for managing todo items built with FastAPI and SQLAlchemy.
Features
- Create, read, update, and delete todo items
- Database migrations with Alembic
- SQLite database
- Health check endpoint
Project Structure
.
├── alembic.ini
├── app
│ ├── api
│ │ ├── endpoints
│ │ │ └── todos.py
│ │ └── routes.py
│ ├── core
│ │ └── config.py
│ ├── crud
│ │ └── todo.py
│ ├── db
│ │ └── session.py
│ ├── models
│ │ └── todo.py
│ └── schemas
│ └── todo.py
├── main.py
├── migrations
│ ├── env.py
│ ├── script.py.mako
│ └── versions
│ └── 001_create_todos_table.py
└── requirements.txt
Installation
- Clone the repository:
git clone <repository-url>
cd simpletodoapplication
- Install dependencies:
pip install -r requirements.txt
Running the Application
Start the application using Uvicorn:
uvicorn main:app --reload
The API will be available at http://localhost:8000.
API documentation is automatically generated and available at:
- http://localhost:8000/docs (Swagger UI)
- http://localhost:8000/redoc (ReDoc)
API Endpoints
GET /health
- Health check endpointGET /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 todo
Database Migrations
To apply migrations:
alembic upgrade head
This is a FastAPI application bootstrapped by BackendIM, the AI-powered backend generation platform.
Description
Languages
Python
94.9%
Mako
5.1%