I am building a JSON-only application, it is basically a leaner Rails, with fewer middleware and fewer modules. This is an application being built in Rails 4.
I want to to develop a simple app that can administrate the data in the database for the main-app. For this I would like to use Active Admin or Rails Admin. But both options somehow use the underlying models and their validations, requirements and such to build on top of.
This means that I need to share at least the models between the main application and the RailsAdmin application.
How would I best do this? Is there a good guide on how to build an administration-application in a separate rails app next to your main one, instead of having it integrated?
As a side note: another good reason to keep the admin in a separate application from the main app, but on a shared database, is the myriad of dependencies, a gem like ActiveAdmin comes with.
Also note that I am not simply interested in running admin on a different domain or different server, but mostly to keep main app lean and focused. And to keep the dependencies with which something like ActiveAdmin comes, out of my main app.
footnotes:
More practical: I don't have Devise (It's a JSON-API, so token-authenticated), don't have any views or template-engine. No Formtastic, No Paperclip, Rmagic, Kminari (pagers) and so on and so forth. All of which will be added to my app when I pull in "just an admin".
This blog post describes an interesting approach: https://content.pivotal.io/blog/migrating-from-a-single-rails-app-to-a-suite-of-rails-engines
They use a nearly empty app as a container and mount their actual apps as Rails Engines.
did you measure the impact of adding tools like ActiveAdmin to the speed of your rest API? if not, this sounds like a case of premature optimization to me.
in the case that the API speed really has an impact by a library that is loaded but not used, then you could create multiple applications and share the models in a git submodule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With