
- 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
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
- Install dependencies:
pip install -r requirements.txt
- Run database migrations:
alembic upgrade head
- Start the application:
uvicorn main:app --reload
The API will be available at http://localhost:8000
API Endpoints
GET /
- Root endpoint with API informationGET /health
- Health check endpointGET /docs
- Interactive API documentation (Swagger UI)GET /redoc
- Alternative API documentationPOST /tasks/
- Create a new taskGET /tasks/
- List all tasks (with pagination)GET /tasks/{task_id}
- Get a specific taskPUT /tasks/{task_id}
- Update a taskDELETE /tasks/{task_id}
- Delete a task
Task Schema
{
"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.
Description
Languages
Python
94%
Mako
6%