1.3 KiB
1.3 KiB
Todo App API
A simple FastAPI-based Todo application with SQLite database.
Features
- Create, read, update, and delete todos
- SQLite database with SQLAlchemy ORM
- Database migrations with Alembic
- CORS enabled for all origins
- Health check endpoint
- Interactive API documentation
API Endpoints
GET /
- Root endpoint with app informationGET /health
- Health check endpointGET /todos/
- Get all todos (with pagination)POST /todos/
- Create a new todoGET /todos/{todo_id}
- Get a specific todoPUT /todos/{todo_id}
- Update a todoDELETE /todos/{todo_id}
- Delete a todo
Documentation
- API documentation:
/docs
- Alternative documentation:
/redoc
- OpenAPI schema:
/openapi.json
Setup and Running
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
uvicorn main:app --reload
The application will be available at http://localhost:8000
.
Database
The application uses SQLite database stored at /app/storage/db/db.sqlite
.
Todo Schema
id
: Integer (auto-generated)title
: String (required)description
: String (optional)completed
: Boolean (default: false)created_at
: DateTime (auto-generated)updated_at
: DateTime (auto-updated)