# service-framework — repo context

> Curated overview for code_search. Source: `direqt-search/service-framework` (GitHub). Shared library.

## Purpose
`@direqt-internal/service-framework` — the **shared foundation for all Direqt
Search backend services**. Provides REST controllers, model services,
authentication middleware, logging, and database connections for
Express/MongoDB/Redis apps on GCP. Consumed by search, api, crawl, index, eval.

## Key exports (from `src/`)
- **`SimpleModelController`** — RESTful CRUD controller with built-in permission
  checks, input validation, and error handling; bridges public resource types ↔
  internal mongoose domain types.
- **`SimpleModelService`** — model/service layer base.
- **`connectMongo`** — MongoDB connection helper.
- **`DireqtLogger` / `morganMiddleware`** — structured logging.
- **`verifyInternal`** — inter-service auth middleware (shared-secret).

## Tech
TypeScript · peer deps Express 4 / Mongoose 8 / Redis 4 · Winston + Morgan logging ·
`google-auth-library` · `express-mongo-sanitize` · Mocha tests.
Depends on `@direqt-internal/common`.
