2.0 KiB
2.0 KiB
Fast Task Manager API
A FastAPI-based RESTful API for managing tasks. This API provides endpoints for creating, reading, updating, and deleting tasks, as well as filtering tasks by status, priority, and completion status.
Features
- RESTful API with CRUD operations for tasks
- Task filtering by status, priority, and completion status
- Pagination support
- Health check endpoint
- SQLite database with SQLAlchemy ORM
- Database migrations with Alembic
Project Structure
├── alembic.ini # Alembic configuration
├── app # Application package
│ ├── crud # CRUD operations
│ ├── database # Database configurations
│ ├── models # SQLAlchemy models
│ ├── routers # API routes
│ └── schemas # Pydantic schemas for validation
├── main.py # FastAPI application entry point
├── migrations # Alembic migrations
│ └── versions # Migration versions
└── requirements.txt # Project dependencies
API Endpoints
Tasks
POST /api/v1/tasks
- Create a new taskGET /api/v1/tasks
- Get list of tasks with filtering and paginationGET /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 and database health
Running the Application
- Clone the repository
- Install the dependencies:
pip install -r requirements.txt
- Apply database migrations:
alembic upgrade head
- Run the application:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
API Documentation
Once the application is running, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc