LiveAdmin

hex packageCI status

An admin UI for Phoenix applications built on Phoenix LiveView and Ecto.

Significant features:

Installation

First, ensure your Phoenix app has been configured to use LiveView.

Add to your app’s deps:

{:live_admin, "~> 0.2"}

Add the following to your Phoenix router in any scope ready to serve a live route:

import LiveAdmin.Router
# ...
live_admin "/admin", resources: [MyApp.SomeEctoSchema]

See LiveAdmin.Router.live_admin/2 for full list of options.

To customize a resource, pass a two element tuple when the schema module as the first element, and a keyword list of options is the second: {MyApp.SomeEctoSchema, opts}

Resource specific options:

App config

In addition, most resource configuration can be set here in order to set a global default to apply to all resources unless overriden in their individual config.

Example:

config :live_admin,
  ecto_repo: MyApp.Repo,
  prefix_options: {MyApp.Accounts, :list_tenant_prefixes, []},
  immutable_fields: [:id, :inserted_at, :updated_at],
  label_with: :name

See development app for more example configuration.