103 lines
1.9 KiB
Markdown
103 lines
1.9 KiB
Markdown
# Simple Todo App
|
|
|
|
A simple todo application built with FastAPI and SQLite.
|
|
|
|
## Features
|
|
|
|
- Create, read, update, and delete todo items
|
|
- Filter todos by completion status
|
|
- Health check endpoint
|
|
- Database migrations with Alembic
|
|
- CORS enabled for all origins
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
.
|
|
├── alembic.ini
|
|
├── app
|
|
│ ├── api
|
|
│ │ ├── health.py
|
|
│ │ └── todos.py
|
|
│ ├── database
|
|
│ │ └── config.py
|
|
│ ├── models
|
|
│ │ └── todo.py
|
|
│ └── schemas
|
|
│ └── todo.py
|
|
├── main.py
|
|
├── migrations
|
|
│ ├── env.py
|
|
│ ├── script.py.mako
|
|
│ └── versions
|
|
│ └── initial_migration.py
|
|
├── pyproject.toml
|
|
├── README.md
|
|
└── requirements.txt
|
|
```
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Python 3.8 or higher
|
|
|
|
### Installation
|
|
|
|
1. Clone the repository:
|
|
|
|
```bash
|
|
git clone <repository-url>
|
|
cd simpletodoapp
|
|
```
|
|
|
|
2. Install dependencies:
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
3. Run database migrations:
|
|
|
|
```bash
|
|
alembic upgrade head
|
|
```
|
|
|
|
4. Start the application:
|
|
|
|
```bash
|
|
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
|
|
```
|
|
|
|
The API will be available at http://localhost:8000
|
|
|
|
## API Documentation
|
|
|
|
Once the application is running, you can access the API documentation at:
|
|
|
|
- Swagger UI: http://localhost:8000/docs
|
|
- ReDoc: http://localhost:8000/redoc
|
|
|
|
## API Endpoints
|
|
|
|
### Todo Endpoints
|
|
|
|
- `GET /api/v1/todos` - Get all todos (with optional filtering)
|
|
- `POST /api/v1/todos` - Create a new todo
|
|
- `GET /api/v1/todos/{todo_id}` - Get a specific todo
|
|
- `PATCH /api/v1/todos/{todo_id}` - Update a todo
|
|
- `DELETE /api/v1/todos/{todo_id}` - Delete a todo
|
|
|
|
### Health Endpoint
|
|
|
|
- `GET /health` - Check application health
|
|
|
|
## Environment Variables
|
|
|
|
The application uses the following environment variables:
|
|
|
|
- None required for basic setup (SQLite database is stored in `/app/storage/db/db.sqlite`)
|
|
|
|
## License
|
|
|
|
MIT |