PhoenixKitCRM

CRM module for PhoenixKit — implements the PhoenixKit.Module behaviour for auto-discovery by a parent Phoenix application.

An interaction-tracking CRM: contacts (people) and companies (legal entities), the interactions logged between them, each with its own media, comments, and activity feed. Roles opt in to CRM access, and every admin gets per-user column configuration.

Features

Files/Images tabs require core Storage to be enabled; the Comments tab requires the phoenix_kit_comments module.

Installation

Add to the parent PhoenixKit app's mix.exs:

# Local development
{:phoenix_kit_crm, path: "../phoenix_kit_crm"}
# or, once published / pinned to a tag
{:phoenix_kit_crm, "~> 0.6"}

Then mix deps.get. The module appears in Admin > Modules and the sidebar automatically; toggle it on to expose /admin/crm.

Routes

PathLiveView
/admin/crmPhoenixKitCRM.Web.CRMLive
/admin/crm/contactsPhoenixKitCRM.Web.ContactsLive
/admin/crm/contacts/new · /:uuid/editPhoenixKitCRM.Web.ContactFormLive
/admin/crm/contacts/:uuidPhoenixKitCRM.Web.ContactShowLive
/admin/crm/companiesPhoenixKitCRM.Web.CompaniesLive
/admin/crm/companies/new · /:uuid/editPhoenixKitCRM.Web.CompanyFormLive
/admin/crm/companies/:uuidPhoenixKitCRM.Web.CompanyShowLive
/admin/crm/lists (+ /new, /:uuid/edit, /:uuid/members, /:uuid/import)PhoenixKitCRM.Web.ListsLive + form/members/import views
/admin/crm/comparisonPhoenixKitCRM.Web.ComparisonLive
/admin/crm/organizationsPhoenixKitCRM.Web.OrganizationsView
/admin/crm/role/:role_uuidPhoenixKitCRM.Web.RoleView
/admin/settings/crmPhoenixKitCRM.Web.SettingsLive

The CRM section appears only after the module is toggled on under Admin > Settings > CRM; per-role subtabs appear for each opted-in role.

Database

The module owns its schema through its own versioned migration chain (PhoenixKitCRM.Migrations, via the PhoenixKit.Module.migration_module/0 callback). V01 adopts the tables core historically created; later versions are this repo's — V05 added the company interaction anchor. The applied version is a crm_schema:<N> comment marker on phoenix_kit_crm_contacts.

The parent app applies both chains via mix phoenix_kit.install / mix phoenix_kit.update (mix phoenix_kit.status reports them).

Settings keys

Development

mix deps.get
mix compile
mix test # unit tests; integration tests excluded if no DB
mix precommit # compile + format + credo --strict + dialyzer

For integration tests, create the test database once:

createdb phoenix_kit_crm_test

The CRM's tables migration ships in phoenix_kit core. Until that core release is published, run the suite against a local core checkout so the test DB migrates to the version that has the CRM tables:

PHOENIX_KIT_PATH=../phoenix_kit mix test

With PHOENIX_KIT_PATH unset, the published Hex pin is used (publish/CI-safe).

See AGENTS.md for the development conventions, file layout, and testing setup.

License

MIT — see LICENSE.