Files
loyaly-catalogue/backend/.env.example
sriram c7e4d59188 Electronics Catalog: API, MCP server, frontend and deployment
Verified catalogue of mobiles and laptops sold in India, collected from
real retail listings (FastAPI backend, React frontend, Postgres/pgvector).

- REST API under /api/elec (read-only catalogue; admin endpoints need login)
- MCP server (FastMCP) at /mcp/ with list_categories, search_products,
  get_product and price_history tools
- Real ratings and reviews read from product pages and search results
- Production Dockerfile (requirements-api.txt, no PyTorch) and
  .env.production.example; remote database only via an explicit
  ELEC_ALLOW_REMOTE_DB host/name allowlist
- docs/API.md: endpoint and MCP reference with live examples

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 12:17:42 +05:30

46 lines
1.3 KiB
Plaintext

# Electronics Catalog backend - LOCAL ONLY. Copy to backend/.env.
# settings.py refuses to start if DB_HOST is not local or DB_NAME is not
# electronics_catalog.
# --- Database (docker-compose.yml at the repo root) ---
DB_HOST=127.0.0.1
DB_PORT=5433
DB_NAME=electronics_catalog
DB_USER=postgres
DB_PASSWORD=change-me-local-only
# --- Local LLM (spec gap-filling from fetched text only) ---
USE_OLLAMA=true
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL_NAME=qwen2.5:1.5b
ELEC_USE_LLM=true
# --- Embeddings ---
USE_EMBEDDINGS=true
EMBEDDINGS_MODEL=sentence-transformers/all-MiniLM-L6-v2
# --- Web search ---
USE_DDG_SEARCH=true
# Optional Google Programmable Search (both required to enable it)
GOOGLE_API_KEY=
GOOGLE_CSE_ID=
SEARCH_REGION=in-en
# --- Polite fetching ---
# A real contact address for the User-Agent header.
ELEC_CONTACT=admin@example.com
ELEC_SITE_MIN_INTERVAL_SECONDS=3
ELEC_REFERENCE_PINCODES=641001:Coimbatore,600001:Chennai
# --- API ---
API_CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
# --- Auth (local dev) ---
# Generate real values with: python -c "import secrets;print(secrets.token_urlsafe(48))"
AUTH_ENABLED=true
AUTH_SECRET_KEY=
AUTH_ADMIN_USERNAME=admin
AUTH_ADMIN_PASSWORD_HASH=
# true = any password is accepted locally (the username still selects the role)
AUTH_ALLOW_ANY_LOGIN=true