|
Download docs/readme.md from asmaakbar/phase-ll: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/spaces/asmaakbar/phase-ll/resolve/main/docs/readme.md
- Command line
-
hf download hf://spaces/asmaakbar/phase-ll/docs/readme.md
-
curl -L -o readme.md https://huggingface.co/spaces/asmaakbar/phase-ll/resolve/main/docs/readme.md
1.85 kB
Todo Backend API Documentation
Overview
The Todo Backend API is a secure, RESTful API built with FastAPI for managing personal tasks. It provides endpoints for creating, reading, updating, and deleting tasks with strict user-based access controls.
Features
- JWT-based authentication
- User isolation - users can only access their own tasks
- Comprehensive error handling
- Async database operations with SQLModel
- Full CRUD operations for tasks
Getting Started
Prerequisites
- Python 3.11+
- Poetry (recommended) or pip
- PostgreSQL database
Installation
- Clone the repository
- Install dependencies:
poetry installorpip install -r requirements.txt - Set up environment variables (see .env.example)
- Run database migrations:
alembic upgrade head - Start the server:
uvicorn backend.src.api.main:app --reload
Environment Variables
DATABASE_URL: Database connection stringBETTER_AUTH_SECRET: Secret key for JWT token signingDEBUG: Enable/disable debug mode
API Endpoints
Authentication
All endpoints require JWT authentication in the Authorization header:
Authorization: Bearer <jwt_token>
Tasks
GET /api/tasks- Get all tasks for the authenticated userPOST /api/tasks- Create a new taskGET /api/tasks/{task_id}- Get a specific taskPUT /api/tasks/{task_id}- Update a specific taskDELETE /api/tasks/{task_id}- Delete a specific taskPATCH /api/tasks/{task_id}/toggle- Toggle task completion status
Error Handling
All errors follow the standard format:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message"
}
}
Security
- All endpoints require authentication
- Users can only access their own tasks
- Input validation on all endpoints
- Secure JWT token handling