
- Set up project structure with FastAPI - Create Todo database model with SQLAlchemy - Add Alembic migrations - Implement CRUD API endpoints for todos - Add health endpoint for application monitoring - Add README with documentation generated with BackendIM... (backend.im)
62 lines
1.6 KiB
Markdown
62 lines
1.6 KiB
Markdown
# Todo Application API
|
|
|
|
This is a RESTful API for managing todo items built with FastAPI and SQLite.
|
|
|
|
## Features
|
|
|
|
- Create, read, update, and delete todo items
|
|
- SQLAlchemy ORM for database interactions
|
|
- Alembic migrations for database versioning
|
|
- Health endpoint for monitoring
|
|
- API documentation with Swagger UI and ReDoc
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
todo-application/
|
|
├── app/
|
|
│ ├── api/ # API endpoints
|
|
│ │ └── v1/ # API version 1
|
|
│ ├── core/ # Core configuration
|
|
│ ├── db/ # Database setup and sessions
|
|
│ ├── models/ # SQLAlchemy models
|
|
│ └── schemas/ # Pydantic schemas
|
|
├── migrations/ # Alembic migrations
|
|
├── alembic.ini # Alembic configuration
|
|
├── main.py # Application entry point
|
|
└── requirements.txt # Dependencies
|
|
```
|
|
|
|
## API Endpoints
|
|
|
|
- `GET /api/v1/todos`: List all todos
|
|
- `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 specific todo
|
|
- `DELETE /api/v1/todos/{todo_id}`: Delete a specific todo
|
|
- `GET /health`: Health check endpoint
|
|
|
|
## Documentation
|
|
|
|
API documentation is available at:
|
|
- Swagger UI: `/docs`
|
|
- ReDoc: `/redoc`
|
|
|
|
## Running the Application
|
|
|
|
```bash
|
|
uvicorn main:app --reload
|
|
```
|
|
|
|
The application will be available at http://localhost:8000.
|
|
|
|
## Development
|
|
|
|
### Requirements
|
|
|
|
- Python 3.8+
|
|
- FastAPI
|
|
- SQLAlchemy
|
|
- Alembic
|
|
- Uvicorn
|
|
- Ruff (for linting) |