
- Create complete task management system with CRUD operations - Add Task model with status, priority, timestamps - Set up SQLite database with SQLAlchemy and Alembic migrations - Implement RESTful API endpoints for task operations - Configure CORS middleware and API documentation - Add health check endpoint and root information response - Include proper project structure and comprehensive README
Task Management API
A simple and efficient task management tool built with FastAPI and SQLite.
Features
- Create, read, update, and delete tasks
- Task prioritization (Low, Medium, High)
- Task status tracking (Pending, In Progress, Completed)
- RESTful API with automatic documentation
- SQLite database with Alembic migrations
API Endpoints
GET /
- Root endpoint with API informationGET /health
- Health check endpointGET /docs
- Interactive API documentation (Swagger UI)GET /redoc
- Alternative API documentation (ReDoc)POST /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
Quick Start
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
uvicorn main:app --reload
-
Access the API documentation at
http://localhost:8000/docs
Project Structure
.
├── main.py # FastAPI application entry point
├── requirements.txt # Python dependencies
├── alembic.ini # Alembic configuration
├── pyproject.toml # Ruff configuration
├── app/
│ ├── db/
│ │ ├── base.py # SQLAlchemy base
│ │ └── session.py # Database session management
│ ├── models/
│ │ └── task.py # Task database model
│ ├── routers/
│ │ └── tasks.py # Task API endpoints
│ └── schemas/
│ └── task.py # Pydantic schemas
├── alembic/
│ ├── versions/ # Migration files
│ └── env.py # Alembic environment
└── storage/
└── db/ # SQLite database location
Database
This application uses SQLite for data storage. The database is automatically created when the application starts. Database migrations are handled by Alembic.
Environment Variables
Currently, the application uses default configurations and doesn't require any environment variables to run.
Description
Languages
Python
93.5%
Mako
6.5%