55 lines
1.6 KiB
Markdown
55 lines
1.6 KiB
Markdown
# SimpleTodoApp API
|
|
|
|
A FastAPI-based backend for a simple Todo application with SQLite database.
|
|
|
|
## Features
|
|
|
|
- Create, read, update, and delete Todo items
|
|
- Health check endpoint
|
|
- SQLite database with SQLAlchemy ORM
|
|
- Database migrations with Alembic
|
|
- Comprehensive API documentation with Swagger UI and ReDoc
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
simpletodoapp/
|
|
├── api/ # API-related code
|
|
│ ├── crud/ # CRUD operations
|
|
│ ├── routers/ # API endpoints
|
|
│ └── schemas/ # Pydantic models for request/response validation
|
|
├── db/ # Database-related code
|
|
│ ├── database.py # Database connection and session
|
|
│ └── models.py # SQLAlchemy models
|
|
├── migrations/ # Alembic migrations
|
|
├── alembic.ini # Alembic configuration
|
|
├── main.py # FastAPI application entry point
|
|
└── requirements.txt # Project dependencies
|
|
```
|
|
|
|
## Installation & Setup
|
|
|
|
1. Clone this repository
|
|
2. Install dependencies:
|
|
```
|
|
pip install -r requirements.txt
|
|
```
|
|
3. Run the application:
|
|
```
|
|
uvicorn main:app --reload
|
|
```
|
|
|
|
## API Documentation
|
|
|
|
Once the server is running, you can access:
|
|
- Swagger UI documentation at `/docs`
|
|
- ReDoc documentation at `/redoc`
|
|
|
|
## API Endpoints
|
|
|
|
- `GET /api/health` - Health check endpoint
|
|
- `GET /api/todos` - List all todos
|
|
- `GET /api/todos/{id}` - Get a single todo by ID
|
|
- `POST /api/todos` - Create a new todo
|
|
- `PATCH /api/todos/{id}` - Update a todo (partial update)
|
|
- `DELETE /api/todos/{id}` - Delete a todo |