tfwright

tfwright

LiveAdmin - Phoenix admin UI built on LiveView

After working on it for a couple of months and using it in production for most of that time, today I’ve released LiveAdmin, a LiveView based Admin UI for Phoenix apps.

Not much to say about it, it follows in the footsteps of Kaffy and ExAdmin before it to provide a pre-rolled “administrator” UI for Ecto/Phoenix apps.

The main thing that sets it apart, aside from using LiveView, is that it has native support for multi tenant applications. I built it primarily to solve my own use case and for the sake of my own curiosity and learning, but its design is also strongly informed by the intention to remain as lean and simple to configure as possible, while providing powerful escape hatches in the form of full view overrides.

Although it is solidly usable now, it is still essentially in the prototype stage, so I would advise trying it out mainly if you have time/energy for a bit of experimentation. That said, I’d really appreciate any testing/feedback and opinions about how to do things differently.

What it has now:

  • Basic CRUD
  • Schema fields autodiscovery
  • Search
  • Editable embeds
  • Editable belongs_to associations via search
  • Resource and record level operations
  • View overrides

Planned:

  • File uploads
  • Dedicated show view
  • Easy CSS overrides
  • Better default CSS
  • Form input overrides

Cheers, and thanks in advance for your thoughts and suggestions.

Most Liked

tfwright

tfwright

Finally releasing v0.8 today :balloon:

Lots of subtle and not so subtle UI changes in this release, including a revamped nav menu. But also, if you’re not a fan of the changes, the nav menu is now one of the components that is available to override :+1:

The new nav bar also contains a new link to manage the Session. LiveAdmin has had a session concept since the beginning, but until now it has been used only to store the prefix to be passed to function overrides so they would be aware of which tenant to run queries in. The new view exposes the session object, including a new metadata key, for editing/adding arbitrary data (using a new MapInput component for map fields). Since the session should be passed to any component/function overrides, you can use it to customize behavior for the current user in all sorts of ways. For example, the css_overrides config now accepts a MFA and the session will be prepended to the arguments. This means you can implement “css themes” using a function that inspects the metadata.

This session has been backed by a very simple Agent so that if you closed the window and later returned, it would remember which prefix you were using. However, due to the state being in a GenServer, this would be erased when that process ended, for example after restarting the app. 0.8 introduces a new session_store config, which allows you to provide your own module implementing the behavior for storing/loading session state. Since the init! callback receives the current conn object, you can use it to identify a logged in user and load/persist their session state to your app’s repo, for example a Postgres DB. That way, any session metadata that user has configured will be preserved even through restarts.

This was the last major feature I planned on adding before releasing 1.0, so please add any requests to the project’s GH issues if there additions you’d like to see included. Other than that future minor releases should focus on documentation, refactors and minor improvements, and bugfixes of course.

tfwright

tfwright

0.10.0 is a big one :face_exhaling:

Feature highlights:

  • added i18n support - use Gettext to translate LiveAdmin copy for non-English speakers, and/or use your own custom terminology in place of what I’ve chosen
  • added single record view (link added to :hamburger: menu) - no more linking to the edit view!
  • added an on_mount callback option to the admin_resource helper - use this to automatically add metadata to your session, which you can then use in your overrides

API changes:

  • The global prefix_options config has been removed in favor of a prefixes function on your Repo module
  • No really public API, but the route_with_params helper has changed a bit so if you are using it in component overrides you should check out changes: Refactor route helper · tfwright/live_admin@e5de5a8 · GitHub
  • LiveAdmin.render_field/3 has been removed. again, not really public API

…I guess that’s it. Well, it felt like a lot :sweat_smile:

Overall upgrading from 0.9.x should not be a big lift, but as usual let me know if you have trouble, and I will add more details here.

tfwright

tfwright

Just released 0.2.

Mainly consists of various minor improvements and bugfixes, but it does contain a fix for a somewhat nasty issue that can cause form views to hang, so I would recommend updating.

Where Next?

Popular in Announcing Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
ostinelli
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New
dbern
I’m excited to announce that TaxJar has developed and open-sourced DateTimeParser. We developed it because we found a need to parse user ...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 12560 134
New
Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
mindok
What is ContEx? A pure Elixir server-side data plotting/charting library outputting SVG. It has nice barcharts in particular and works g...
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47930 226
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New

We're in Beta

About us Mission Statement