I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps:
-
bureaucrat - which contains a bunch of generators to create very feature-rich CRUD views for your resources (with filtering, sorting and proper pagination out of the box)
-
forage (the name comes from the rummage package) - which does the bulk of the work by allowing easy creating of dynamic ecto queries based on plug query parameters. It also contains widgets which make it easy to create search filters, pagination widgets, etc. It acts as a bridge between the form in the frontend and the ecto queries in the backend. Unlike rummage, it’s coupled to plug applications, while rummage tries to be frontend-independent. I don’t think that in the current state of the elixir ecosystem decoupling it from plug is worth it.
Documentation is severely lacking, but those who are interested can look at an example project here: https://github.com/tmbb/bureaucrat_demo_app
The packages lack a lot of documentation, and I’ll work on that over the next weeks now that I’m happy with the functionality.
Roadmap
I’m planning on doing the following:
-
Documentation, documentation, documentation…
-
In particular, documenting forage’s functionality, because it can be useful outside Bureaucrat. I do try very hard to make it work as a black box, that is, as longa s you use the correct widgets in the frontend things should just work, but people who want to extend it need some guidance.
-
Make Paginator (a library which I use for pagination) support ecto 3.
-
Improving forage so that it is less dependent on the Repo. Everything should work with “raw” ecto queries independent of the Repo. That will probably require some PRs to the paginator package which I use for pagination.
-
Make bureaucrat play better with many-to-many relations. That will require working mostly on forage, and only minor changes to Bureaucrat itself
-
Make bureaucrat independent of JQuery, and find a better way to packaging the necessary Javascript. The current generated templates get all JS and CSS from a CDN and embed some inline Javascript to make the Select2 widgets work.
-
Write a proper tutorial, based on [this tutorial](https://flask-appbuilder.readthedocs.io/en/latest/quickminimal.html, for the Flask application framework (which is a python project)