
- Added environment variable support via .env file - Updated API routes with versioning prefix - Improved documentation in README - Enhanced SQLite database path configuration generated with BackendIM... (backend.im)
85 lines
2.0 KiB
Markdown
85 lines
2.0 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
|
|
- RESTful API with OpenAPI documentation
|
|
- SQLite database with SQLAlchemy ORM
|
|
- Alembic for database migrations
|
|
- Environment variable configuration support
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
.
|
|
├── alembic/ # Database migration scripts
|
|
├── app/ # Application code
|
|
│ ├── api/ # API endpoints
|
|
│ │ ├── v1/ # API version 1
|
|
│ │ │ └── endpoints/ # API endpoints
|
|
│ ├── core/ # Core application code
|
|
│ ├── crud/ # CRUD operations
|
|
│ ├── db/ # Database setup
|
|
│ ├── models/ # SQLAlchemy models
|
|
│ └── schemas/ # Pydantic schemas
|
|
├── main.py # Application entry point
|
|
├── alembic.ini # Alembic configuration
|
|
└── requirements.txt # Dependencies
|
|
```
|
|
|
|
## Installation
|
|
|
|
1. Clone the repository:
|
|
|
|
```bash
|
|
git clone https://github.com/yourusername/simpletodoapp.git
|
|
cd simpletodoapp
|
|
```
|
|
|
|
2. Install dependencies:
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
3. Configure environment variables (optional):
|
|
Create a `.env` file with your configuration options
|
|
|
|
4. Run database migrations:
|
|
|
|
```bash
|
|
alembic upgrade head
|
|
```
|
|
|
|
## Usage
|
|
|
|
1. Start the server:
|
|
|
|
```bash
|
|
uvicorn main:app --reload
|
|
```
|
|
|
|
2. Access the API documentation at:
|
|
- Swagger UI: http://localhost:8000/docs
|
|
- ReDoc: http://localhost:8000/redoc
|
|
|
|
## API Endpoints
|
|
|
|
All API endpoints are prefixed with `/api/v1`
|
|
|
|
- `GET /api/v1/todos`: Get all todos
|
|
- `GET /api/v1/todos/{id}`: Get a specific todo
|
|
- `POST /api/v1/todos`: Create a new todo
|
|
- `PUT /api/v1/todos/{id}`: Update a todo
|
|
- `DELETE /api/v1/todos/{id}`: Delete a todo
|
|
|
|
## Health Check
|
|
|
|
- `GET /health`: Health check endpoint
|
|
|
|
## License
|
|
|
|
MIT |