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

tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: GitHub - tmbb/phoenix_ws: Websockets implemented over Phoenix Ch...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
dominicletz
Hi, I thought I had posted my library before but seems I hadn’t. The project is still in early stages but it’s growing and so I think it...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New
mbuhot
Leverage Open Api 3.0 (Swagger) to document, test, validate and explore your Plug and Phoenix APIs. Generate and serve a JSON Open API ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
josevalim
Hello everyone, We have just released NimbleCSV which is a small and fast CSV parsing library for Elixir. It allows developers to define...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New

Other popular topics Top

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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