# search — repo context

> Curated overview for code_search. Source: `direqt-search/search` (GitHub). Node.js/TypeScript backend.

## Purpose
**Core search engine backend** for the Direqt Search product. Manages search
applications, content indexing, search query execution, and **AI-powered answer
generation**. Exposes a **public search API** for end-users plus **internal APIs**
consumed by the console, dashboard, and evaluation tools.

## Structure (top-level dirs)
- `search-api/` — the public/internal search API surface
- `gateway-api/` — gateway-facing API
- `dashboard-api/` — API used by the publisher dashboard
- `src/` — service implementation (search, indexing, answer generation)
- `config/` — env samples / configuration
- `scripts/`, `test/`

## Answer engines
Answer generation lives under `src/services/answerEngines/` (e.g. `geminiAnswer`,
`legolasAnswer`, `nazgulAnswer`, `meriadocAnswer`) — these take a `SearchRequest`
and produce AI answers/suggestions from the top search results.

## Tech
Node.js 22 · TypeScript 5 · Express · MongoDB (Mongoose) · Redis · Google Vertex AI
(Discovery Engine, Gemini) · OpenAI (GPT) · GCP (Cloud Run, Tasks, Pub/Sub, Storage,
Secret Manager, BigQuery) · Stripe (billing) · Auth0 · Mocha/Chai/Sinon tests.
Depends on internal packages: `@direqt-internal/{crawl-api,iam-api,index-api,metrics,service-framework}`.
