
- 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)
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 taskGET /api/v1/tasks/{task_id}
: Get a specific taskPUT /api/v1/tasks/{task_id}
: Update a taskDELETE /api/v1/tasks/{task_id}
: Delete a task
Health Check
GET /health
: Check API health
Installation and Setup
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Run database migrations:
alembic upgrade head
- Start the application:
uvicorn main:app --reload
API Documentation
FastAPI automatically generates interactive API documentation at:
/docs
: Swagger UI/redoc
: ReDoc
License
MIT
Description
Languages
Python
95.9%
Mako
4.1%