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
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
leave
Minimal configuration for leave management-only deployments.
Modules enabled: Leave Management, Admin
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)
Individual Module Overrides
You can override individual modules on top of any profile usingMODULE_<NAME> environment variables.
Example: Disable AI in SMB Deployment
Example: Enable CRM in Core Profile
Available Modules
| Module | Variable | Toggleable |
|---|---|---|
| User | N/A | ❌ Always-on |
| Organizations | N/A | ❌ Always-on |
| Leave | MODULE_LEAVE | ✅ Yes |
| CRM | MODULE_CRM | ✅ Yes |
| Automation | MODULE_AUTOMATION | ✅ Yes |
| Bulk | MODULE_BULK | ✅ Yes |
| Export | MODULE_EXPORT | ✅ Yes |
| Reports | MODULE_REPORTS | ✅ Yes |
| AI | MODULE_AI | ✅ Yes |
| Notifications | MODULE_NOTIFICATIONS | ✅ Yes |
| Admin | MODULE_ADMIN | ✅ Yes |
Configuration Precedence
The configuration system applies settings in this order (highest to lowest priority):- Hardcoded — User and Organizations are always enabled
- Individual overrides —
MODULE_<NAME>environment variables - Profile baseline —
APP_PROFILEpreset
Common Deployment Scenarios
Production (Full Features)
Staging (Selective Disable)
CI/Tests (Minimal Startup)
Leave Management Only
Observability
Startup Logging
The server logs module configuration at startup:Health Check Endpoint
The/health endpoint includes per-module status:
- Frontend feature detection
- DevOps tooling verification
- Debugging module initialization issues
Backward Compatibility
IfAPP_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
| Variable | Default | Valid Values | Purpose |
|---|---|---|---|
APP_PROFILE | full | full, smb, leave, core | Select named module preset |
Module Overrides
| Variable | Default | Type | Purpose |
|---|---|---|---|
MODULE_LEAVE | (profile) | bool | Override Leave module |
MODULE_CRM | (profile) | bool | Override CRM module |
MODULE_AUTOMATION | (profile) | bool | Override Automation module |
MODULE_BULK | (profile) | bool | Override Bulk module |
MODULE_EXPORT | (profile) | bool | Override Export module |
MODULE_REPORTS | (profile) | bool | Override Reports module |
MODULE_AI | (profile) | bool | Override AI module |
MODULE_NOTIFICATIONS | (profile) | bool | Override Notifications module |
MODULE_ADMIN | (profile) | bool | Override Admin module |
Configuration File Example
Update your.env file:
Related Documentation
- Architecture Overview:
docs/backend/go/architecture/ - Getting Started:
docs/backend/go/getting-started.mdx - Troubleshooting:
docs/backend/go/guides/troubleshooting.md