Module Configuration Guide

Overview

The Go backend uses a configuration-driven module loading system that allows you to selectively enable or disable optional modules. This enables:
  • Fast startup times in CI/test environments by loading only essential modules
  • Environment-specific feature control without code changes
  • Fine-grained module management through named profiles and individual overrides

App Profiles

Profiles are named presets that set the initial state of all module flags. Choose a profile based on your deployment needs:

full (Default)

Enables all optional modules. Use this in production environments where all features are needed. Modules enabled:
  • Leave Management
  • CRM
  • Automation
  • Bulk Operations
  • Export
  • Reports
  • AI
  • Notifications
  • Admin
# Default profile (no configuration needed)
APP_PROFILE=full
Or simply omit APP_PROFILE entirely—it defaults to full.

smb

Optimized for small-to-medium business (SMB) deployments with all business modules enabled. Modules enabled: Leave, CRM, Automation, Bulk, Export, Reports, AI, Notifications, Admin
APP_PROFILE=smb

leave

Minimal configuration for leave management-only deployments. Modules enabled: Leave Management, Admin
APP_PROFILE=leave

core

Minimal configuration with only core functionality. Use in CI/test environments to reduce startup time and resource usage. Modules enabled: User, Organizations (always-on)
APP_PROFILE=core

Individual Module Overrides

You can override individual modules on top of any profile using MODULE_<NAME> environment variables.

Example: Disable AI in SMB Deployment

APP_PROFILE=smb
MODULE_AI=false
Result: All SMB modules are enabled except AI.

Example: Enable CRM in Core Profile

APP_PROFILE=core
MODULE_CRM=true
Result: Only core modules plus CRM are enabled.

Available Modules

ModuleVariableToggleable
UserN/A❌ Always-on
OrganizationsN/A❌ Always-on
LeaveMODULE_LEAVE✅ Yes
CRMMODULE_CRM✅ Yes
AutomationMODULE_AUTOMATION✅ Yes
BulkMODULE_BULK✅ Yes
ExportMODULE_EXPORT✅ Yes
ReportsMODULE_REPORTS✅ Yes
AIMODULE_AI✅ Yes
NotificationsMODULE_NOTIFICATIONS✅ Yes
AdminMODULE_ADMIN✅ Yes

Configuration Precedence

The configuration system applies settings in this order (highest to lowest priority):
  1. Hardcoded — User and Organizations are always enabled
  2. Individual overridesMODULE_<NAME> environment variables
  3. Profile baselineAPP_PROFILE preset

Common Deployment Scenarios

Production (Full Features)

APP_PROFILE=full
All optional modules enabled. Use when all features are needed.

Staging (Selective Disable)

APP_PROFILE=full
MODULE_AI=false
Start with all features but disable experimental AI features for stability testing.

CI/Tests (Minimal Startup)

APP_PROFILE=core
Load only essential core modules. Fastest startup time for test runs.

Leave Management Only

APP_PROFILE=leave
Dedicated leave management deployment.

Observability

Startup Logging

The server logs module configuration at startup:
{
  "level": "info",
  "msg": "Module configuration",
  "user": true,
  "organizations": true,
  "leave": true,
  "crm": false,
  "automation": false,
  "bulk": false,
  "export": true,
  "reports": true,
  "ai": false,
  "notifications": true,
  "admin": true
}
This log confirms which modules are enabled after profile and overrides are applied.

Health Check Endpoint

The /health endpoint includes per-module status:
curl http://localhost:8080/health
Response:
{
  "status": "healthy",
  "modules": {
    "user": { "enabled": true },
    "organizations": { "enabled": true },
    "leave": { "enabled": true },
    "crm": { "enabled": false },
    "automation": { "enabled": false },
    "bulk": { "enabled": false },
    "export": { "enabled": true },
    "reports": { "enabled": true },
    "ai": { "enabled": false },
    "notifications": { "enabled": true },
    "admin": { "enabled": true }
  }
}
Use this endpoint for:
  • Frontend feature detection
  • DevOps tooling verification
  • Debugging module initialization issues

Backward Compatibility

If APP_PROFILE is not set, the system defaults to full, enabling all modules exactly as they were before this feature. Existing deployments require zero changes.

Environment Variable Reference

Profile Selection

VariableDefaultValid ValuesPurpose
APP_PROFILEfullfull, smb, leave, coreSelect named module preset

Module Overrides

VariableDefaultTypePurpose
MODULE_LEAVE(profile)boolOverride Leave module
MODULE_CRM(profile)boolOverride CRM module
MODULE_AUTOMATION(profile)boolOverride Automation module
MODULE_BULK(profile)boolOverride Bulk module
MODULE_EXPORT(profile)boolOverride Export module
MODULE_REPORTS(profile)boolOverride Reports module
MODULE_AI(profile)boolOverride AI module
MODULE_NOTIFICATIONS(profile)boolOverride Notifications module
MODULE_ADMIN(profile)boolOverride Admin module

Configuration File Example

Update your .env file:
# Full profile (default)
APP_PROFILE=full

# Or use core profile for CI
# APP_PROFILE=core

# Or disable specific modules
# APP_PROFILE=smb
# MODULE_AI=false
  • Architecture Overview: docs/backend/go/architecture/
  • Getting Started: docs/backend/go/getting-started.mdx
  • Troubleshooting: docs/backend/go/guides/troubleshooting.md