Skip to content

Feature Flags and Settings Tabs

Chris Nighswonger edited this page Apr 2, 2026 · 6 revisions

Feature Flags and Settings Tabs

This page explains how feature visibility and settings behavior are controlled in Kanfei.

Feature Flag Model

Frontend feature visibility is controlled via config-backed flags loaded from /api/config.

Primary flags:

  • nowcast_enabled
  • spray_enabled
  • map_enabled

Frontend mapping is implemented in frontend/src/context/FeatureFlagsContext.tsx.

Behavior:

  • sidebar/routes for Nowcast, Spray, and Map are conditionally shown
  • routes redirect when disabled
  • Settings changes can refresh flags without full app restart

Setup Gating

Before normal app routes are shown, frontend checks GET /api/setup/status.

  • if setup_complete=false, Setup Wizard is shown
  • if true, full app shell is rendered

Settings Areas (Current Functional Grouping)

The Settings page is a broad operational surface including:

  • station connection settings (serial or network, depending on hardware type)
  • unit display preferences
  • hardware operations (capability-dependent — varies by station type)
  • alert threshold configuration
  • theme/background customization
  • nowcast configuration
  • spray-related toggles
  • upload integrations (WU/CWOP)
  • messaging bots (Telegram, Discord) — in dedicated Bots tab
  • usage/cost monitoring
  • DB admin operations
  • account management (password change, API key generation/revocation)

Key Config Buckets

Station and Core

  • station_driver_type — hardware driver type
  • serial_port, baud_rate — serial connection (serial drivers only)
  • poll_interval
  • latitude, longitude, elevation
  • setup_complete, station_timezone

Display/Units

  • temp_unit, pressure_unit, wind_unit, rain_unit

Forecast/Output

  • nws_enabled
  • metar_enabled, metar_station

Alerts

  • alert_thresholds (JSON structure)

Uploads

  • WU: wu_enabled, wu_station_id, wu_station_key, wu_upload_interval
  • CWOP: cwop_enabled, cwop_callsign, cwop_upload_interval

Telegram Bot

  • bot_telegram_enabled, bot_telegram_token, bot_telegram_chat_id
  • bot_telegram_commands, bot_telegram_notifications
  • See Telegram Bot for setup details

Discord Bot

  • bot_discord_enabled, bot_discord_token, bot_discord_guild_id, bot_discord_channel_id
  • bot_discord_commands, bot_discord_notifications
  • See Discord Bot for setup details

Nowcast/Spray

  • nowcast_mode (local/remote) — determines which nowcast engine is used
  • nowcast_remote_url — URL of remote nowcast service (remote mode)
  • other nowcast keys (nowcast_* family)
  • spray_enabled, spray_ai_enabled

Usage/Budget

  • anthropic_admin_api_key
  • usage_budget_monthly_usd
  • usage_budget_auto_pause
  • usage_budget_paused

DB Admin

Operational actions exposed via API/UI:

  • stats
  • JSON export/backup
  • compaction
  • purge operations

Runtime Refresh Behavior

Many services re-read config periodically or per operation.

Practical effect:

  • many toggles/settings apply quickly
  • connection parameter changes may require reconnect
  • some long-lived operations may require service restart depending on state

Related Pages

Clone this wiki locally