diff --git a/.gitignore b/.gitignore index ae9ac7c..8b9c088 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,4 @@ logs/ Thumbs.db # Project specific +backend/models_cache/ diff --git a/backend/app/api/router.py b/backend/app/api/router.py index 1aece31..0bba686 100644 --- a/backend/app/api/router.py +++ b/backend/app/api/router.py @@ -1,10 +1,8 @@ """API router aggregation.""" -from fastapi import APIRouter - from app.api.routes.v1 import v1_router -api_router = APIRouter() - -# API v1 routes (prefix is set in main.py via settings.API_V1_STR) -api_router.include_router(v1_router) +# Direct alias — avoids FastAPI 0.135+ validation that rejects routes with +# empty raw paths (e.g. @router.get("")) when include_router has no prefix. +# The prefix (settings.API_V1_STR) is applied in main.py. +api_router = v1_router diff --git a/backend/app/core/config.py b/backend/app/core/config.py index b628a6c..5352564 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -9,10 +9,14 @@ from pydantic_settings import BaseSettings, SettingsConfigDict def find_env_file() -> Path | None: - """Find .env file in current or parent directories.""" + """Find .env file in current, parent, or backend/ subdirectory.""" current = Path.cwd() - for path in [current, current.parent]: - env_file = path / ".env" + for candidate in [ + current, + current.parent, + current / "backend", + ]: + env_file = candidate / ".env" if env_file.exists(): return env_file return None diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 9806508..fdf8cab 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -60,6 +60,7 @@ dependencies = [ # Cross-encoder reranking for RAG "sentence-transformers>=3.0.0", "torch>=2.0.0", + "httpx>=0.28.1", ] [project.optional-dependencies] @@ -192,3 +193,8 @@ exclude_lines = [ [tool.fastapi-fullstack] generator_version = "0.2.11" generated_at = "2026-06-15T06:18:30.904341+00:00" + +[dependency-groups] +dev = [ + "httpx>=0.28.1", +] diff --git a/backend/uv.lock b/backend/uv.lock index 8505f13..85a778c 100644 --- a/backend/uv.lock +++ b/backend/uv.lock @@ -21,6 +21,7 @@ dependencies = [ { name = "fastapi-cache2" }, { name = "fastapi-pagination" }, { name = "greenlet" }, + { name = "httpx" }, { name = "jinja2" }, { name = "langchain-text-splitters" }, { name = "logfire", extra = ["asyncpg", "fastapi", "redis"] }, @@ -62,6 +63,11 @@ dev = [ { name = "ty" }, ] +[package.dev-dependencies] +dev = [ + { name = "httpx" }, +] + [package.metadata] requires-dist = [ { name = "alembic", specifier = ">=1.18.0" }, @@ -73,6 +79,7 @@ requires-dist = [ { name = "fastapi-cache2", specifier = ">=0.2.2" }, { name = "fastapi-pagination", specifier = ">=0.12.31" }, { name = "greenlet", specifier = ">=3.2.0" }, + { name = "httpx", specifier = ">=0.28.1" }, { name = "httpx", marker = "extra == 'dev'", specifier = ">=0.28.0" }, { name = "jinja2", specifier = ">=3.1.0" }, { name = "langchain-text-splitters", specifier = ">=0.4.0" }, @@ -111,6 +118,9 @@ requires-dist = [ ] provides-extras = ["dev"] +[package.metadata.requires-dev] +dev = [{ name = "httpx", specifier = ">=0.28.1" }] + [[package]] name = "aiofile" version = "3.11.1"