This project is a full-stack, self-hosted web search engine prototype.
It crawls content, stores raw pages and links, computes ranking signals (including PageRank), indexes documents in Elasticsearch, and serves ranked results through a FastAPI API and a React frontend.
- A practical end-to-end search stack you can run locally with Docker Compose.
- A playground for experimenting with crawler quality, ranking, retrieval, and query UX.
- A benchmarkable system with evaluation scripts for relevance (
hit@k,MRR) and latency.
The end goal is to build a reliable, explainable search system that can:
- Continuously ingest useful web content at scale.
- Rank results with better relevance than naive keyword matching.
- Serve fast, stable search responses through a simple product UI.
- Improve over time using measurable metrics (quality + performance) rather than guesswork.
In short: move from a crawler/indexing prototype to a production-ready retrieval foundation.
crawler/— Scrapy spider (scrapy-redisbased), URL discovery, page extraction, and Postgres writes.indexer/— Reads pages/links from Postgres, computes PageRank, and indexes to Elasticsearch.api/— FastAPI service (/search,/suggest,/chat,/health) backed by Elasticsearch.frontend/— React + Vite search UI.scripts/— evaluation and operational utilities (search_eval.py,stress_eval.py, etc.).
Core infrastructure (via docker-compose.yml):
- Redis (crawl frontier)
- PostgreSQL (raw pages + link graph)
- Elasticsearch (search index)
- Crawler, indexer, API, frontend services
- Seed URLs are loaded (curated/broad/Tranco or explicit seed file/env values).
- Crawler fetches pages (respecting robots/politeness), extracts text/metadata/links.
- Pages + link graph are stored in Postgres.
- Indexer computes PageRank + site-level authority signals.
- Documents are indexed into Elasticsearch.
- API executes search + suggestions and returns ranked results to the frontend.
From the repo root:
docker compose up -d --build redis postgres elasticsearch
docker compose up -d --build crawler
docker compose run --rm indexer python sync.py
docker compose up -d --build api frontendThen open:
- Frontend: http://localhost:5173
- API docs: http://localhost:8000/docs
Run from the repo root once API is up:
python scripts/search_eval.py
python scripts/stress_eval.pysearch_eval.pytracks retrieval quality withhit@1,hit@3,hit@5, andMRR.stress_eval.pytracks latency and failure patterns under a fixed query suite.
- Works as a local full-stack demo for crawling + indexing + search.
- Includes relevance/latency evaluation loops.
- Suitable as a base for ranking improvements, recrawl freshness strategies, and future AI-assisted retrieval features.