Backpex - a highly customizable admin panel for Phoenix LiveView applications

Hello - I’m building an integration with Ash for my app, using the existing Backpex adapter as a starting point.

Ideally I’ll be able to open source this as a standalone AshExtension, or contribute it straight to Backpex in the future.

Would it be possible for me to get into the Backpex Slack?

I’d appreciate being able to either participate in any conversations that might impact this, or at least be aware of them ahead of time so I can prep for any changes that will break my integration.

I also already have a small wish list for you :joy:

And THANK YOU for a great library :tada::tada::tada::tada::tada: I’m at a point where building the integration feels better than the alternatives, as a business decision. I think that says a lot your incredible work.

7 Likes

Hey @eileennoonan!

First, thanks for your work on the Backpex Ash support. Many people have asked about it, but since we don’t use it in any of our apps, we haven’t made much progress in the last few months. Nevertheless, we are very interested in providing full support for Ash with Backpex. Having one of our community members work on it means a lot to us! :raising_hands:

Would it be possible for me to get into the Backpex Slack?

I see that you’ve already joined the Backpex Slack, great!

Ideally I’ll be able to open source this as a standalone AshExtension, or contribute it straight to Backpex in the future.

Having it as a standalone package is great. Regarding your wish list, write down whatever you need to build the Ash adapter. We’ll support you wherever we can.

6 Likes

Woohoo! Thanks so much!

I’m gonna respond in the Slack and hopefully keep a single avenue of communication :slight_smile:

2 Likes

All the best in this effort.
I think it would be great to utilize Ash own resources and policies definitions instead of requiring the developer to add specific resources definitions to utilize Backpex “I think this aligns more with Ash idea of define once , derive the rest” as long as it is possible.

4 Likes

This is, indeed, what we are doing! AshBackpex derives defaults for the Backpex configuration from the Ash resource itself.

defmodule MyAppWeb.Live.Admin.PostLive do
    use AshBackpex.LiveResource

    backpex do
      resource MyApp.Blog.Post
      load [:author]
      layout({MyAppWeb.Layouts, :admin})

      fields do
        field :title
        field :published_at

        field :author do
          display_field(:name)
          live_resource(MyAppWeb.Live.Admin.AuthorLive)
        end
      end

      filters do
        filter :state do
          module MyAppWeb.Live.Admin.Filters.PostStateFilter
        end
      end
    end
end

As time goes on we’ll see what more can be derived. For example in something like that PostStateFilter referenced, say the Post resource has 3 valid states of [:published, :draft, :trashed]. We could derive that filter from those configured constraints.

Policies are still not fully supported. We will need to do a bit of work in Backpex to make that compatible everywhere a given resource is queried.

For now I’m only using AshBackpex in a high-trust environment where all the users are admins anyway. I will be looking into getting policies fully compatible in the coming weeks/months!

4 Likes

Are there any examples or screenshots of customized views? What I’ve seen so far, on the Backpex page and demo are fairly simple CRUD views.

Backpex v0.14 release

We’re excited to announce the release of Backpex v0.14! :tada:

Key highlights:

  1. Enhanced filter flexibility: Filters now receive assigns in their query and options callbacks, giving you more context and control.
  2. Simplified field rendering: We’ve removed the render_form_readonly/1 callback from fields, making it easier to understand and implement custom fields.
  3. URL field improvements: A new allowed_schemes option for URL fields lets you restrict which URL schemes are valid.

Breaking changes:

This release includes several breaking changes:

  • Filter callbacks now receive assigns as a parameter
  • The input/1 component has been updated
  • Item actions with a form now require a changeset/3 callback
  • The render_form_readonly/1 callback has been removed from fields

Please refer to the Upgrade Guide for detailed migration instructions.

Other improvements:

  • Empty sidebar sections are now hidden by default
  • Added support for live macro options for Backpex routes
  • Improved multi-select design
  • Fixed several bugs including HasMany field errors, permission checking in BelongsTo fields, and index form input ID conflicts
  • Documentation improvements covering installation, filters, and alignment options

We’ve also enhanced our demo application with the Phoenix LiveView debugger, making it easier to explore and understand Backpex behavior.

3 Likes

Hello @Flo0807 ,

Any plan to add RBAC “Role based access management” to Backpex ?
Backpex seems like a perfect place to manage users/roles since it is building the interface to do the admin work.

Very sad move.
Forcing bleeding edge on your users is not a good idea in general.
While Tailwind 4.x has many cool features, it drops support for a lot of older browsers, which is not a good tradeoff for existing projects on 3.x. Also some extensions don’t have support for 4.x It looks like there’s nothing special in 4.x that you couldn’t achieve with 3.x. So 3.x is not obsolete at all.

Hey, we use Backpex in some projects with different roles and permissions being involved. The can? callbacks can get you quite far. Currently, there is no plan to improve this or add dedicated features for RBAC.

I think it is a good idea if you create a discussion with requirements and feature wishes. Then we can see if others want to see such RBAC features/improvements as well.

In general, you are always welcome to contribute features and improvements to Backpex by submitting a PR (note that its always a good idea to submit an issue/discussion first to discuss implementation details).

1 Like

Hey! First, thanks for your feedback! :raising_hands:

It looks like there’s nothing special in 4.x that you couldn’t achieve with 3.x

Backpex depends on daisyUI, which dropped support for Tailwind v3 in its latest major update. Sticking with v3 would mean being stuck with an older version of daisyUI, with limited access to bug fixes and new features. Additionally, Tailwind CSS v4, especially the simplified installation process, made things easier for us. We developed a Backpex installer that was much easier to implement with Tailwind v4 (to be released in the next version of Backpex).

it drops support for a lot of older browsers

In v4.1, Tailwind improved compatibility with older versions of Safari and Firefox, so this shows the team is committed to maintaining broad browser support. See the v4.1 changelog.

In general, Backpex is still in a 0.X version, so things like major dependency upgrades and breaking changes are to be expected.

They still require a browser released not earlier than 2 years ago.
There’s absolutely no excuse to break people’s projects this way. The tech behind v.3 is still working and will continue to work for the foreseeable future.
Lost visitors/users on incompatible browsers directly translate to lost revenue. Shiny new toys for developers don’t translate to business outcomes. And then we complain that companies don’t take Elixir seriously.

If that distinction is worth real money how much of it are you investing for the maintainers to stick with tw3 – and likely decouple it from users style pipeline to support people using phoenix 1.8 with tw4? Unless you’re paying for it you cannot expect open source maintainers to work by your personal business constraints – no matter how valid your pov may be.

7 Likes

I’m not a newcomer to open source world and I’ve had my own OS projects.
I’m sorry if you got the impression that I’m expecting or demanding.

Excited to see action around Ash + Backpex. Good job @eileennoonan!

It had snuck me by: GitHub - enoonan/ash_backpex: Ash Integration for Backpex

So the limitations mentioned on using Ash’s access and policy stuff is a limitation on how it can be hooked into backpex?

3 Likes

Hi @lawik, thanks for the kind words!

Up to now, yes, I haven’t been able to fully use Ash policies because the current_user aka actor isn’t present everywhere queries are being made.

I know that the Backpex folks added the assigns in more places with the 0.14 release, but I haven’t been able to dig deeply into that yet.

Some backstory on this integration - I started it so that I could use it in my own application for my web accessibility startup called Insi. Since then, I have been extremely busy with other aspects of this startup, and haven’t had the bandwidth to push ash_backpex any further than what met Insi’s immediate needs.

However, I’m going to. We can get away with limited authz for the moment because we’re only using it as an internal admin for now. The whole thing is walled off. But we will eventually want a more full-featured customer-facing admin as well as all the other Backpex bells and whistles.

My dream is to get it all hooked up with Igniter and be able to present a demo of creating a full featured AshBackpex app in like 15 minutes via the command line.

I guess I’m writing all this extra stuff to say I’m worried people think I have abandoned this - I have not! We have an #ash_backpex channel in the Ash Discord and Zach Daniel and other Ash maintainers have already been a big help!

8 Likes

We all have a limited amount of time in this world, and browser APIs move quickly.

It may be better to rip off the band-aid now and have a product that still works in 5 years, as opposed to having to maintain a legacy system, and watch as yet another Phoenix admin package eats your lunch because you’re stuck with a bunch of old code that you don’t have time to upgrade.

If you don’t like it, there are alternatives, like Kaffy.

Like it or not, the ecosystem has settled on using Tailwind v4. (see also: Phoenix 1.8)

1 Like

There’s no band-aid. 3.x is perfectly fine, unless you enforce artificial obsoletion. There’s no rush to upgrade.

Or you could upgrade just in time, when all users have moved on to newer devices/browsers so you are not losing anything, you know.
In other words: don’t fix something that is not broken. And TW 3.x is clearly not broken. As is the tech behind it.
Also, not every code must be upgraded. Some code will work forever without an upgrade.

Nonsense, TW 3.x is still supported. The generated code can easily be adjusted, and it works only for new projects anyway.

they didn’t break anything. It’s free, and literally every revision is available on GH. So the thing they already gave you(for free) you still have(for free). They simply released more stuff(for free) that you don’t like when compared to the old stuff(that was free)

There is a conveniently placed “fork” button if you wish to invest the effort in maintaining a version of backpex using tw3.

With all that in mind, there is no “excuse” needed :slight_smile:

17 Likes

My heart goes out to all the maintainers who have to put up with these incessant complaints, day in and day out.

2 Likes