Automated Action d60cfb5c4f Create Task Manager API with FastAPI and SQLite
- Set up FastAPI project structure
- Create Task model with SQLAlchemy
- Set up Alembic for migrations
- Create CRUD operations for tasks
- Implement API endpoints for tasks
- Add health check endpoint
- Update documentation

generated with BackendIM... (backend.im)
2025-05-13 23:23:43 +00:00

82 lines
1.9 KiB
Markdown

# Task Manager API
A simple and efficient Task Manager API built with FastAPI and SQLite.
## Features
- Create, read, update, and delete tasks
- Filter tasks by completion status
- Set task priorities
- Set due dates for tasks
- Health check endpoint
## Technology Stack
- **Python**: 3.8+
- **Web Framework**: FastAPI
- **ORM**: SQLAlchemy 2.0+
- **Database**: SQLite
- **Migrations**: Alembic
- **Linting**: Ruff
## Project Structure
```
taskmanagerapi/
├── alembic/ # Database migration scripts
│ └── versions/ # Migration versions
├── app/ # Application module
│ ├── api/ # API endpoints
│ │ └── routes/ # API route handlers
│ ├── core/ # Core application code
│ ├── crud/ # CRUD operations
│ ├── db/ # Database setup and connections
│ ├── models/ # SQLAlchemy models
│ └── schemas/ # Pydantic models for validation
├── main.py # Application entry point
└── requirements.txt # Project dependencies
```
## API Endpoints
### Tasks
- `GET /api/v1/tasks`: Get all tasks (with optional filtering)
- `POST /api/v1/tasks`: Create a new task
- `GET /api/v1/tasks/{task_id}`: Get a specific task
- `PUT /api/v1/tasks/{task_id}`: Update a task
- `DELETE /api/v1/tasks/{task_id}`: Delete a task
### Health Check
- `GET /health`: Check API health
## Installation and Setup
1. Clone the repository
2. Install dependencies:
```
pip install -r requirements.txt
```
3. Run database migrations:
```
alembic upgrade head
```
4. Start the application:
```
uvicorn main:app --reload
```
## API Documentation
FastAPI automatically generates interactive API documentation at:
- `/docs`: Swagger UI
- `/redoc`: ReDoc
## License
MIT