Loading repository data…
Loading repository data…
hanzala-sohrab / repository
A comprehensive FastAPI-based backend application for task management with user authentication, CRUD operations, integrated LLM capabilities using Ollama, and vector search capabilities.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A comprehensive FastAPI-based backend application for task management with user authentication, CRUD operations, integrated LLM capabilities using Ollama, and vector search capabilities.
git clone <repository-url>
cd task-manager-backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
uv sync
cp .env.example .env # If .env.example exists
# Edit .env with your configuration
alembic upgrade head
uvicorn app.main:app --reload
The API will be available at http://localhost:8000
Once the server is running, you can access:
http://localhost:8000/docshttp://localhost:8000/redocThe API endpoints are organized into the following tags for better navigation and documentation:
users: User authentication and management endpointsitems: General item management endpointstasks: Task management and CRUD operationsllm: LLM integration and AI-powered featuresusers tag)POST /users/register - Register a new userPOST /users/login - User login and JWT token generationtasks tag)POST /tasks/ - Create a new taskGET /tasks/ - Get all tasks with paginationGET /tasks/{task_id} - Get a specific taskPUT /tasks/{task_id} - Update a taskDELETE /tasks/{task_id} - Delete a taskGET /tasks/user/{user_id} - Get tasks by userGET /tasks/status/{status} - Get tasks by statusGET /tasks/search/ - Vector search tasks by title or descriptionitems tag)POST /items/ - Create a new itemGET /items/ - Get all itemsGET /items/{item_id} - Get a specific itemPUT /items/{item_id} - Update an itemDELETE /items/{item_id} - Delete an itemllm tag)POST /llm/chat - Chat completion with OllamaPOST /llm/completion - Text completion with OllamaGET /llm/models - List available Ollama modelsPOST /llm/models/pull - Pull a new modelDELETE /llm/models/{model_name} - Delete a modelThe application now includes vector search capabilities for tasks using:
GET /tasks/search/?query=your_search_query
The search endpoint accepts a query parameter and returns tasks ranked by semantic similarity to the search query.
task-manager-backend/
├── alembic/
│ ├── versions/ # Database migration files
│ ├── env.py # Alembic environment configuration
│ ├── script.py.mako # Migration script template
│ └── README
├── app/
│ ├── routers/ # API route modules
│ │ ├── items.py # Item-related endpoints
│ │ ├── llm.py # LLM integration endpoints
│ │ ├── tasks.py # Task management endpoints
│ │ └── users.py # User authentication endpoints
│ ├── auth.py # Authentication utilities
│ ├── config.py # Application configuration
│ ├── crud.py # Database CRUD operations
│ ├── database.py # Database connection and vector DB setup
│ ├── main.py # FastAPI application entry point
│ ├── models.py # SQLAlchemy database models
│ └── schemas.py # Pydantic schemas for request/response
├── alembic.ini # Alembic configuration
├── requirements.txt # Python dependencies
└── README.md # This file
The application can be configured through environment variables. Key configuration options:
DATABASE_URL: Database connection string (default: sqlite:///./test.db)SECRET_KEY: JWT secret key (default: CHANGE_THIS - change in production!)OLLAMA_HOST: Ollama server host (default: http://localhost:11434)OLLAMA_MODEL: Default Ollama model (default: llama3.2)OLLAMA_TIMEOUT: Ollama request timeout in seconds (default: 30)To create new database migrations:
app/models.pyalembic revision --autogenerate -m "Description of changes"
alembic upgrade head
To rollback migrations:
alembic downgrade -1
pytest
The project follows PEP 8 coding standards. You can check code style with:
flake8 app/
app/models.pyapp/schemas.pyapp/crud.pyapp/routers/SECRET_KEY in productionThis project is licensed under the MIT License.