Runtime registry of all PhoenixKit modules (internal and external).
External modules are auto-discovered from beam files via PhoenixKit.ModuleDiscovery.
Any dep that depends on :phoenix_kit and uses use PhoenixKit.Module is found
automatically — no config line needed.
External Module Registration
External hex packages are auto-discovered. Just add the dep:
{:phoenix_kit_hello_world, "~> 0.1.0"}For explicit registration (backwards compatible):
config :phoenix_kit, :modules, [PhoenixKitHelloWorld]Runtime Registration
PhoenixKit.ModuleRegistry.register(MyModule)
PhoenixKit.ModuleRegistry.unregister(MyModule)Query API
ModuleRegistry.all_modules() # All registered module atoms
ModuleRegistry.enabled_modules() # Only currently enabled
ModuleRegistry.all_admin_tabs() # Collect admin tabs from all modules
ModuleRegistry.all_settings_tabs() # Collect settings tabs
ModuleRegistry.all_user_dashboard_tabs() # Collect user dashboard tabs
ModuleRegistry.all_children() # Collect supervisor child specs
ModuleRegistry.all_permission_metadata() # Collect permission metadata
ModuleRegistry.feature_enabled_checks() # Build {mod, :enabled?} map
ModuleRegistry.get_by_key("tickets") # Find module by key
Summary
Functions
Collect all admin tabs from all registered modules.
Collect all supervisor child specs from all registered modules.
Returns all feature module key strings from registered modules.
Returns all registered module atoms.
Collect permission metadata from all registered modules.
Collect route modules from all registered modules.
Collect all settings tabs from all registered modules.
Collect all user dashboard tabs from all registered modules.
Returns a specification to start this module under a supervisor.
Returns all registered modules that are currently enabled.
Build a feature_enabled_checks map from registered modules.
Find a registered module by its key string.
Check if the registry has been initialized.
Collect modules that have versioned migrations.
Returns permission descriptions map from registered modules.
Returns permission icons map from registered modules.
Returns permission labels map from registered modules.
Register a module that implements PhoenixKit.Module behaviour.
Collect supervisor child specs from the static module list.
Unregister a module.
Functions
@spec all_admin_tabs() :: [PhoenixKit.Dashboard.Tab.t()]
Collect all admin tabs from all registered modules.
Note: iterates all modules and calls admin_tabs/0 on each call.
For cached access in rendering paths, use PhoenixKit.Dashboard.Registry.get_admin_tabs/0.
@spec all_children() :: [Supervisor.child_spec()]
Collect all supervisor child specs from all registered modules.
@spec all_feature_keys() :: [String.t()]
Returns all feature module key strings from registered modules.
@spec all_modules() :: [module()]
Returns all registered module atoms.
@spec all_permission_metadata() :: [PhoenixKit.Module.permission_meta()]
Collect permission metadata from all registered modules.
@spec all_route_modules() :: [module()]
Collect route modules from all registered modules.
@spec all_settings_tabs() :: [PhoenixKit.Dashboard.Tab.t()]
Collect all settings tabs from all registered modules.
@spec all_user_dashboard_tabs() :: [PhoenixKit.Dashboard.Tab.t()]
Collect all user dashboard tabs from all registered modules.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec enabled_modules() :: [module()]
Returns all registered modules that are currently enabled.
Build a feature_enabled_checks map from registered modules.
Returns %{"customer_service" => {PhoenixKit.Modules.CustomerService, :enabled?}, ...}
Find a registered module by its key string.
@spec initialized?() :: boolean()
Check if the registry has been initialized.
Collect modules that have versioned migrations.
Returns a list of {module_name, migration_module} tuples for all registered
modules that implement migration_module/0 and return a non-nil value.
Returns permission descriptions map from registered modules.
Returns permission icons map from registered modules.
Returns permission labels map from registered modules.
@spec register(module()) :: :ok
Register a module that implements PhoenixKit.Module behaviour.
@spec static_children() :: [Supervisor.child_spec()]
Collect supervisor child specs from the static module list.
This does NOT require the GenServer to be running, making it safe to call from the PhoenixKit.Supervisor init (before the registry starts).
@spec unregister(module()) :: :ok
Unregister a module.