Skip to content

Feature Flag Module

Public Summary

Runtime feature toggles for conditional feature enablement across the application.

Internal Details

Files

Standard CRUD layer: controller, service, routes, schema, model, repository (7 files).

Endpoints

MethodPathAuthDescription
GET/flagsPublicKey-value flag list (public consumption)
GET/flags/adminJWTDetailed flag list with metadata
PUT/flags/:idJWTToggle flag

Data Model — FeatureFlag

key        : String (unique, required)
enabled    : Boolean (default: false)
description: String

Current Flags

KeyPurpose
ai-searchEnables hybrid vector+keyword search
smart-searchEnables recipe decomposition search

Integration Pattern

Backend services check flags at runtime:

js
const flag = await featureFlagService.getByKey('ai-search');
if (flag?.enabled) { /* use AI path */ }

Frontend fetches flags on load via featureFlagStore and gates UI components.

Source Anchors

PathRelevance
apps/server/src/modules/feature-flag/Controller, service, routes, schema, model, repository

Student Obrok engineering documentation.