How tarekulislam03/nexus works
Nexus is a web search engine: users submit a query through the browser UI, and the FastAPI application serves live-web or local-index results, with optional AI overviews. The backend also supports crawling pages into the local index, index statistics and autocomplete. Ranking, text processing, and index storage form the core retrieval layer. The excerpts show several internal calls directly; some API orchestration is omitted, so documented workflow links use the README as evidence rather than implying source inspection.
Main entry points: main.py FastAPI application · inverted_index.py Inverted index · web_search.py Live web search · crawler.py Page crawler
Components 15
Search interface
- Search UI
static/app.js
API and orchestration
- FastAPI application
main.py - Search cache
main.py
Retrieval and indexing
- Live web search
backend/web_search.py - Page crawler
backend/crawler.py - BM25 and TF-IDF
backend/ranker.py - Inverted index
backend/inverted_index.py - Seed documents
backend/seed_data.py - Text processor
backend/text_processor.py
Search enrichment
- AI overview
backend/ai_summarizer.py
Other components
- Search user
- DuckDuckGo
- Web pages
- OpenRouter
- Google Gemini
Connections 19
- Search user → Search UI: submits query
README.md - Search UI → FastAPI application: requests search
static/app.js - FastAPI application → Search cache: checks cache
main.py - FastAPI application → Live web search: fetches web results
README.md - FastAPI application → BM25 and TF-IDF: ranks local results
README.md - FastAPI application → AI overview: generates overview
README.md - FastAPI application → Page crawler: starts crawl
README.md - FastAPI application → Inverted index: serves index data
main.py - FastAPI application → Seed documents: loads seed corpus
main.py - Live web search → DuckDuckGo: queries
backend/web_search.py - Live web search → Web pages: fetches content
backend/web_search.py - Page crawler → Web pages: fetches pages
backend/crawler.py - Page crawler → Inverted index: adds documents
backend/crawler.py - Inverted index → Text processor: tokenizes documents
backend/inverted_index.py - BM25 and TF-IDF → Inverted index: reads postings
backend/ranker.py - BM25 and TF-IDF → Text processor: processes queries
backend/ranker.py - Seed documents → Inverted index: adds seed documents
backend/seed_data.py - AI overview → OpenRouter: requests summaries
backend/ai_summarizer.py - AI overview → Google Gemini: uses fallback
backend/ai_summarizer.py