settings feature flags - BevvyTech/BrewskiDocs GitHub Wiki
Settings – Feature Flags
Route:/settings/feature-flags
Access: Super user team members only (membership on a team with role = su).
Purpose
Review every record in the feature_flags table and adjust the default platform state for each flag.
Create new flags manually when planning upcoming launches.
Remove obsolete flags once no code paths depend on them.
Key Interactions
Registered flags table: Lists all flags with their description, default state, and last update timestamp. Super users can toggle the default state inline; each switch issues a PATCH /feature-flags/:id request and immediately persists the change.
Flag editor form: Supports creating a new flag (key + description + default state) or updating the selected flag’s metadata. Keys are immutable after creation to match backend expectations; the form enforces the same validation ([a-z0-9_.-]+) used by the API.
Delete control: Removes the selected flag via DELETE /feature-flags/:id. Overrides cascade automatically, mirroring the Prisma schema.
Notes
Flags are auto-created when backend code calls isFeatureFlagEnabled(key, { autoCreate: true }). The page surfaces those ad-hoc entries so platform owners can fill in descriptions or adjust their state.
Only super user teams can see this navigation item; other users hitting the route are redirected back to /settings.