Simple Todo App
A simple Todo application API built with FastAPI and SQLite.
Features
- Create, read, update, and delete Todo items
- Automatically track creation and update timestamps
- Health check endpoint
- Database migrations with Alembic
- API documentation with Swagger UI and ReDoc
Installation
- Clone the repository:
git clone <repository-url>
cd simpletodoapp-cstnbs
- Install dependencies:
pip install -r requirements.txt
- Run database migrations:
alembic upgrade head
Running the application
Start the application with Uvicorn:
uvicorn main:app --reload
The API will be available at http://localhost:8000
API Documentation
Once the application is running, you can access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
Todo Endpoints
GET /todos
: Get all todo itemsPOST /todos
: Create a new todo itemGET /todos/{todo_id}
: Get a specific todo itemPUT /todos/{todo_id}
: Update a specific todo itemDELETE /todos/{todo_id}
: Delete a specific todo item
Health Check
GET /health
: Check the health status of the application
Project Structure
simpletodoapp-cstnbs/
├── app/
│ ├── api/
│ │ └── routes.py # API route definitions
│ ├── core/
│ │ └── config.py # Application configuration
│ ├── db/
│ │ └── database.py # Database connection setup
│ ├── models/
│ │ └── todo.py # SQLAlchemy models
│ ├── schemas/
│ │ └── todo.py # Pydantic schemas for API
│ └── storage/
│ └── db/ # SQLite database storage
├── migrations/ # Alembic migrations
│ ├── versions/
│ │ └── *.py # Migration scripts
│ ├── env.py # Alembic environment
│ └── script.py.mako # Migration script template
├── alembic.ini # Alembic configuration
├── main.py # Application entry point
├── requirements.txt # Project dependencies
└── README.md # This file
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Description
Languages
Python
94.8%
Mako
5.2%