1.4 KiB
1.4 KiB
Todo API Application
This is a simple Todo API application built with FastAPI and SQLite.
Features
- Create, Read, Update, and Delete todos
- Health endpoint for monitoring application status
- SQLite database for data persistence
- Alembic for database migrations
Project Structure
simpletodoapplication/
├── app/
│ ├── __init__.py
│ ├── database.py
│ ├── models.py
│ └── schemas.py
├── migrations/
│ ├── versions/
│ │ └── 001_create_todos_table.py
│ ├── env.py
│ ├── README
│ └── script.py.mako
├── alembic.ini
├── main.py
└── requirements.txt
API Endpoints
GET /health
- Check API healthGET /todos
- Get all todosPOST /todos
- Create a new todoGET /todos/{todo_id}
- Get a specific todoPUT /todos/{todo_id}
- Update a todoDELETE /todos/{todo_id}
- Delete a todo
Requirements
- Python 3.8+
- Dependencies listed in requirements.txt
Installation and Setup
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Run database migrations:
alembic upgrade head
- Start the server:
uvicorn main:app --reload
API Documentation
Once the application is running, you can access:
- Swagger UI documentation at
/docs
- ReDoc documentation at
/redoc