# api — repo context

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

## Purpose
**Administrative API Gateway** for Direqt Search. Handles **identity & access
management (IAM)**, user authentication (Auth0), **network (organization)
management** with RBAC, and acts as an **authenticated proxy** to the internal
Search, Crawl, and Index services (adding authorization headers). Also handles
media uploads (GCS) and a Search Eval proxy.

## Structure (top-level dirs)
- `src/` — gateway implementation (auth, IAM, proxy, routing)
- `iam-api/` — IAM API surface / types
- `config/`, `scripts/`, `test/`

## Role in the system
Front door for the **Console** and **Dashboard** frontends: authenticates their
requests, enforces multi-tenant network isolation, then proxies to internal
microservices. Runs locally on **port 8080**.

## Tech
Node.js 22 · TypeScript · Express · MongoDB · Redis (optional cache) · Auth0 ·
`http-proxy` · GCP (Storage, Secret Manager, Pub/Sub, Tasks) · Mocha tests.
Depends on `@direqt-internal/{iam-api,search-api,service-framework}`.
