Skip to content

Configuration

fulleni edited this page Jan 18, 2026 · 1 revision

🔧 Configuration & Environment

The API Server is configured using the 12-Factor App methodology. Configuration is strictly separated from code.

🌍 Environment Variables

The system reads configuration from environment variables loaded from a .env file in the project root.

  • Class: EnvironmentConfig (lib/src/config/environment_config.dart)
  • Mechanism: On startup, the system searches for a .env file starting from the current directory and traversing up to the project root (identified by pubspec.yaml).
  • Validation: It provides type-safe accessors that throw a StateError if a required variable (like DATABASE_URL) is missing, preventing the app from starting in a broken state.

📡 Remote Config

Dynamic behavior (feature flags, limits) is managed via Remote Config, stored in the database.

  • Model: RemoteConfig (packages/core)
  • Storage: remote_configs collection.
  • Usage: Services fetch this config at runtime to determine behavior (e.g., "Is the Rewards feature enabled?", "Which Analytics provider is active?").
  • Management: This config is editable via the Flutter Web Dashboard.

Clone this wiki locally