
- Add SQLite database configuration - Create Todo model, schemas, and CRUD operations - Implement Todo API endpoints - Add Alembic migration for todo table - Set up database initialization in main.py - Update README with project details and instructions - Add pyproject.toml with Ruff configuration
69 lines
1.4 KiB
Markdown
69 lines
1.4 KiB
Markdown
# Todo API
|
|
|
|
This is a FastAPI Todo API application that allows you to manage todo items.
|
|
|
|
## Features
|
|
|
|
- Create, read, update, and delete todo items
|
|
- Filter todos by completion status and title
|
|
- Pagination support
|
|
- SQLite database backend
|
|
- Alembic migrations
|
|
|
|
## Requirements
|
|
|
|
- Python 3.9+
|
|
- FastAPI
|
|
- SQLAlchemy
|
|
- Alembic
|
|
- Uvicorn
|
|
- Other dependencies in requirements.txt
|
|
|
|
## Installation
|
|
|
|
1. Clone the repository
|
|
2. Install the dependencies:
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
## Database Setup
|
|
|
|
The application uses SQLite as the database backend. The database will be automatically created in the `/app/storage/db` directory when the application starts.
|
|
|
|
To run the database migrations:
|
|
|
|
```bash
|
|
alembic upgrade head
|
|
```
|
|
|
|
## Running the Application
|
|
|
|
Start the application with Uvicorn:
|
|
|
|
```bash
|
|
uvicorn main:app --reload
|
|
```
|
|
|
|
The API will be available at http://localhost:8000
|
|
|
|
## API Documentation
|
|
|
|
The API documentation is available at:
|
|
|
|
- Swagger UI: http://localhost:8000/docs
|
|
- ReDoc: http://localhost:8000/redoc
|
|
|
|
## API Endpoints
|
|
|
|
- `GET /api/v1/todos`: List all todos with optional filtering
|
|
- `POST /api/v1/todos`: Create a new todo
|
|
- `GET /api/v1/todos/{todo_id}`: Get a specific todo
|
|
- `PUT /api/v1/todos/{todo_id}`: Update a todo
|
|
- `DELETE /api/v1/todos/{todo_id}`: Delete a todo
|
|
|
|
## Health Check
|
|
|
|
The application includes a health check endpoint at `/health` that can be used to verify that the service is running properly.
|