CRM 0.1.0: First release, the CRM section and role pages
CRM 0.1.0 is the first release of the CRM module for PhoenixKit. It adds a CRM section to the admin with a page for each role you choose, listing that role’s users. It is an early base: it has no contacts, companies or interactions.
What it gives a site
Add the package to your Phoenix app and PhoenixKit finds it on its own, with no router changes. The module shows up under Admin > Modules and gets a CRM entry in the sidebar with an Overview page. The Overview is a placeholder card that shows whether the CRM is on and links to CRM settings.
Role pages
On the settings page at /admin/settings/crm, the Role Access section lists the site’s roles, apart from system roles such as Owner and Admin. Tick a role and it gets its own page under the CRM in the sidebar, listing every user who holds it. Each administrator chooses which columns to show there, such as Email, Username, Full Name, Status, Registered, Last Confirmed and Location, reorders them by dragging, and can switch between a table and cards. The choice is saved per administrator.
Settings
The settings page has an Enable CRM switch, the same setting as on the Modules page, the Role Access list and an Enable Companies switch. That switch shows a Companies page, which in this release is a placeholder: an empty table with a column picker and a notice, in Russian, that the feature is still being built.
Installing
Add {:phoenix_kit_crm, "~> 0.1"} to your app’s dependencies and run mix deps.get. The CRM needs PhoenixKit 1.7. Its two tables, for role access and saved columns, come from PhoenixKit core’s migrations, so run mix phoenix_kit.update. Then turn the CRM on under Modules or in its settings.
Full release notes: CRM 0.1.0
0.1.0 · 30 April 2026
First public release of the CRM module for PhoenixKit. Implements the
PhoenixKit.Module behaviour for auto-discovery; ships an admin
sidebar tab with Overview, optional Companies subtab, per-role user
listings, and a settings page. Most of the moving pieces are
backbone — the Companies legal-entity schema is a deliberate
placeholder, ready to land in 0.2.x.
Added
- Module behaviour & auto-discovery —
PhoenixKitCRMimplementsPhoenixKit.Module:module_key/0,module_name/0,enabled?/0,enable_system/0,disable_system/0,version/0,permission_metadata/0,admin_tabs/0,settings_tabs/0,route_module/0,css_sources/0,children/0. Discovered at startup via the@phoenix_kit_modulebeam attribute — the host app needs no router edits. - Admin pages — Overview LiveView at
/admin/crm, Companies subtab at/admin/crm/companies(gated bycrm_companies_enabled), per-role user listings at/admin/crm/role/:role_uuid, and the settings page at/admin/settings/crm. All useuse PhoenixKitWeb, :live_viewso they render inside the admin layout with the standard core components (<.icon>,<.button>,TableDefault, …). - Role opt-in flow —
PhoenixKitCRM.RoleSettingscontext (list_enabled/0,list_eligible_roles/0,set_enabled/2,enabled?/1) backed byphoenix_kit_crm_role_settings(role_uuidPK, FK tophoenix_kit_user_roles). System roles (Owner, Admin) are excluded from the eligible set; the rest can be toggled per role from the CRM settings page. - Per-user, per-scope view configuration —
PhoenixKitCRM.UserRoleViewcontext backed byphoenix_kit_crm_user_role_view((user_uuid, scope)unique; JSONBview_config; UUIDv7 PK). Scope is:companies | {:role, role_uuid}.PhoenixKitCRM.ColumnConfigdeclares available + default columns per scope and validates input. - Column-management mixin —
use PhoenixKitCRM.Web.ColumnManagementinjects the seven event handlers (show_column_modal,hide_column_modal,add_column,remove_column,reorder_selected_columns,update_table_columns,reset_to_defaults) shared betweenRoleViewandCompaniesView. The reusablePhoenixKitCRM.Web.ColumnModalfunction component drives drag-to- reorder selected columns + click-to-add available columns; UX matches thePhoenixKit.Userstable column picker. - Companies subtab placeholder —
CompaniesViewrenders the table/card view with column picker and a “schema in development” banner. The legal-entity schema lands in a future release. - Runtime sidebar bootstrap —
PhoenixKitCRM.SidebarBootstrap(one-shotTaskviachildren/0,restart: :temporary) registers per-role tabs intoPhoenixKit.Dashboard.Registryunder the:phoenix_kit_crm_rolesnamespace. Re-run fromPhoenixKitCRM.refresh_sidebar/0after eachRoleSettings.set_enabled/2call. No watcher GenServer. - Route module —
PhoenixKitCRM.Routesdeclares the parameterizedlive "/admin/crm/role/:role_uuid"route that resolves the runtime-registered role tabs. Definesadmin_routes/0andadmin_locale_routes/0with unique:asaliases; spliced intophoenix_kit’slive_session :phoenix_kit_admin. PhoenixKitCRM.Paths— centralized URL helpers (index/0,companies/0,role/1,settings/0) routed throughPhoenixKit.Utils.Routes.path/1for prefix/locale handling.- Settings keys —
crm_enabled(module on/off, also reflected on the admin Modules page),crm_companies_enabled(Companies subtab visibility). - Test infrastructure —
PhoenixKitCRM.Test.Repo,PhoenixKitCRM.DataCase(auto-tags:integration, sandbox setup),test_helper.exs(db-availability check viapsql -lqt,uuid_generate_v7()SQL function setup, ExUnit start). Integration tests are auto-excluded when the test DB is absent. - Tests — 33 in total: behaviour and tab-shape tests
(
phoenix_kit_crm_test.exs), pure-function tests forColumnConfig(available_columns,default_columns,validate_columns,get_column_metadata, cross-scope rejection) andUserRoleView(scope_to_string,scope_from_stringincluding the malformed-input fallback path, the round-trip property,default_config). mix test.setup/mix test.resetaliases andcli/0preferred_envsso the alias auto-runs in:test.:lazy_htmltest-only dep forPhoenix.LiveViewTest.- Documentation —
README.mdcovers features, install, routes, database, settings keys, and dev workflow.AGENTS.mdis the AI-agents guide modeled onphoenix_kit_hello_worldandphoenix_kit_staff— covers the actual scaffold, runtime sidebar bootstrap pattern + known limitation, per-user column config, conventions, route-module + tab hybrid, test infrastructure, and versioning. PR review template + first review atdev_docs/pull_requests/2026/1-add-crm-module/.
Notes
- Migrations for
phoenix_kit_crm_role_settingsandphoenix_kit_crm_user_role_viewlive inphoenix_kitcore (V105), not in this repo. The parent app applies them viamix phoenix_kit.install/mix phoenix_kit.update. enabled?/0rescues errors and returnsfalseso the module degrades gracefully when the DB isn’t available (boot race, migration in progress).refresh_sidebar/0logsLogger.warningon Registry errors instead of silently rescuing — Registry API drift surfaces in logs rather than leaving stale role tabs.UserRoleView.scope_from_string/1falls back to:companiesand logs a warning on malformed input — defends against data corruption causing render-time crashes.
CRM 0.1.0. Install or update: {:phoenix_kit_crm, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.