This project consists of two main components: a front-end application and an API. Together, they form a product search platform where users can browse, search, and filter products using a hybrid search mechanism that combines lexical and semantic techniques.
- Front-end: A React application responsible for displaying products, handling user interactions, and performing searches via the API.
- API: A backend service that provides product data and search capabilities, including faceted filtering and hybrid search logic.
- Built with React.
- Handles product display, search, and filtering.
- Communicates with the API to retrieve and display products.
- Developed with Python
- Provides endpoints for fetching product data and handling search/filter requests.
- Implements hybrid search combining lexical and semantic search techniques.
- Read: README.md
- Read: README.md
This guide shows how to run the stack with or without Docker.
- Node.js 18+
- Python 3.10+
- Elasticsearch 9.x (via Docker or local install)
Default Elasticsearch dev credentials:
- URL: http://localhost:9200
- Username: elastic
- Password: changeme
These are referenced in:
backend/api/api.py→get_client_es()backend/ingestion/ingestion.py→get_client_es()backend/infra/create_index.py→get_client_es()
Backend loads settings from environment variables (via python-dotenv). Create backend/.env from the example:
cp backend/.env.example backend/.envAvailable variables:
ES_HOST=http://localhost:9200
ES_USERNAME=elastic
ES_PASSWORD=changemeThese are used by the API, ingestion, and index creation scripts.
- Start Elasticsearch + Kibana
cd backend/docker
docker compose up -d- Elasticsearch: http://localhost:9200
- Kibana: http://localhost:5601
- Create index and mappings
cd ../infra
uv run create_index.py- Ingest dataset with vectors
cd ../ingestion
uv run ingestion.py- Run the backend API (FastAPI)
cd ../api
uv sync
uv run uvicorn api:app --host 127.0.0.1 --port 5000 --reload- Run the frontend (React)
cd ../../frontend
npm install
npm startOpen http://127.0.0.1:3000 (frontend) → API at http://127.0.0.1:5000.
- Install and start Elasticsearch 9.x locally with:
xpack.security.enabled=truediscovery.type=single-node- Heap (example):
-Xms4g -Xmx4g
- Create index and ingest
# terminal A
cd backend/infra
uv run create_index.py
# terminal B
cd ../ingestion
uv run ingestion.py- Start backend API
cd backend/api
uv sync
uv run uvicorn api:app --host 127.0.0.1 --port 5000 --reload- Start frontend
cd frontend
npm install
npm startGET /api/products/search— query with optional facets andhybrid=trueGET /api/products/facets— facet countsGET /api/products/id/{product_id}— product detailsGET /api/products/suggest— autocomplete
- If API can’t reach ES: check
localhost:9200, credentials, and index creation. - Hybrid search errors: ensure index created via
backend/infra/create_index.pyand data ingested. - Frontend CORS/issues: API runs on 127.0.0.1:5000; URLs are hard-coded in
frontend/src/App.js. - Slow ingestion: first run downloads
sentence-transformers/all-MiniLM-L6-v2model.
cd backend/docker && docker compose up -d \
&& cd ../infra && uv run create_index.py \
&& cd ../ingestion && uv run ingestion.py \
&& cd ../api && uv sync && uv run uvicorn api:app --host 127.0.0.1 --port 5000 --reloadIn another terminal:
cd frontend && npm install && npm start