How kgpianghosh006/codequery works
CodeQuery is a DSA problem search engine. Its data workflow gathers problems from three platforms, combines them into a JSON corpus, and builds an in-memory TF-IDF index; its user workflow sends a query and optional platform filter from the web UI to the API, which ranks matching problems and returns results. The graph keeps collection, indexing, API, and UI responsibilities distinct. Runtime relationships are grounded in the excerpts and README; corpus files are represented by their enclosing directory. I have not inspected unsampled source.
Main entry points: server.js Search endpoint · index.js Scraper registry · script.js Search interface · build_corpus.js Corpus builder
Components 15
Problem collection
- LeetCode scraper
scripts/scrapers/leetcode.js - Codeforces scraper
scripts/scrapers/codeforces.js - AtCoder scraper
scripts/scrapers/atcoder.js - Scraper registry
scripts/scrapers/index.js
Corpus and index
- Corpus builder
scripts/build_corpus.js - Problem corpus
backend/corpus - Index builder
backend/server.js - Text preprocessing
backend/utils/preprocess.js
Search API
- Search endpoint
backend/server.js
Web interface
- API configuration
frontend/config.js - Search interface
frontend/script.js
Other components
- Search user
- LeetCode
- Codeforces
- AtCoder
Connections 17
- Search user → Search interface: submits query
frontend/script.js - Search interface → API configuration: uses API base
- Search interface → Search endpoint: posts query
frontend/script.js - Search endpoint → Search interface: returns results
frontend/script.js - API configuration → Search endpoint: routes API calls
README.md - Scraper registry → LeetCode scraper: registers scraper
scripts/scrapers/index.js - Scraper registry → Codeforces scraper: registers scraper
scripts/scrapers/index.js - Scraper registry → AtCoder scraper: registers scraper
scripts/scrapers/index.js - Corpus builder → Scraper registry: uses scrapers
scripts/build_corpus.js - Corpus builder → Problem corpus: writes corpus
scripts/build_corpus.js - LeetCode scraper → LeetCode: fetches problems
scripts/scrapers/leetcode.js - Codeforces scraper → Codeforces: fetches problems
scripts/scrapers/codeforces.js - AtCoder scraper → AtCoder: fetches problems
scripts/scrapers/atcoder.js - Index builder → Problem corpus: reads corpus
backend/server.js - Index builder → Text preprocessing: normalizes documents
backend/server.js - Search endpoint → Text preprocessing: normalizes query
backend/server.js - Search endpoint → Index builder: scores indexed terms
backend/server.js