Mandarin + Forage - An admin tool for phoenix

Ok, I’ve implemented the “low code” solution as described above and I’m actually very unhappy with it. It’s not customizable and I couldn’t get it to play well with any practical real-world application. I’m back to the generators.

My generators use “feature folders” or “vertical slices”, as discussed here, instead of splitting a “feature” into a controller folder, a view folder and a templates folder. I’ve settled on this architectures because it’s my favorite filesystem layout for “normal” (that is, non-mandarin) phoenix applications. Nonetheless, mandarin plays well with already existing applications which split the controllers, views and templates into their own directories.

I now have a Mandarin.Designer module with is a fancy programmatic interface to the command-line Mandarin and Phoenix generators. It gives you some tools to generate HTML, contexts and schemas in a phoenix app in a proper Elixir program, instead of painstakingly run the generators manually in the command line. I call it the Designer because it’s usefull to design your application’s data layer upfront and then generate it all at once. It is also very useful to generate multiple admin interfaces/CRUD pages for the same project.

Speaking of CRUD pages, I think Mandarin is now very usable for “normal” CRUD pages with fancy features like (multi-)select witgets which support Ecto associations (including many-to-many relations, although those take some manual work to get right). The biggest catch is that you have to be ok with using bootstrap templates. I couldn’t find a way of generating templates that don’t depend heavily on a CSS framework.

I’m quite happy with mandarin and forage right now, and I might relase a v1.0 soon for both packages.

1 Like