Automated Action f63bd5104b Add Task Manager API with FastAPI and SQLite
- Created FastAPI application structure with main.py
- Implemented SQLAlchemy models for tasks with priority and completion status
- Set up database connection with SQLite using absolute paths
- Created Alembic migrations for database schema
- Added CRUD operations for task management
- Implemented health check and root endpoints
- Added CORS configuration for cross-origin requests
- Created comprehensive API documentation
- Added Ruff configuration for code linting
- Updated README with installation and usage instructions
2025-06-24 07:52:20 +00:00

65 lines
1.4 KiB
Markdown

# Task Manager API
A simple task management API built with FastAPI and SQLite.
## Features
- Create, read, update, and delete tasks
- Task priority levels (low, medium, high)
- Task completion status tracking
- Automatic timestamps for creation and updates
- Health check endpoint
- Interactive API documentation
## Installation
1. Install dependencies:
```bash
pip install -r requirements.txt
```
2. Run database migrations:
```bash
alembic upgrade head
```
3. Start the application:
```bash
uvicorn main:app --reload
```
The API will be available at `http://localhost:8000`
## API Endpoints
- `GET /` - Root endpoint with API information
- `GET /health` - Health check endpoint
- `GET /docs` - Interactive API documentation (Swagger UI)
- `GET /redoc` - Alternative API documentation
- `POST /tasks/` - Create a new task
- `GET /tasks/` - List all tasks (with pagination)
- `GET /tasks/{task_id}` - Get a specific task
- `PUT /tasks/{task_id}` - Update a task
- `DELETE /tasks/{task_id}` - Delete a task
## Task Schema
```json
{
"title": "string",
"description": "string (optional)",
"completed": false,
"priority": "medium"
}
```
Priority levels: `low`, `medium`, `high`
## Database
The application uses SQLite with the database file stored at `/app/storage/db/db.sqlite`.
## Environment Variables
No environment variables are required for basic operation. The application uses SQLite with default settings.