Multiple independent Laravel Nova Dashboards in different routes? - laravel-nova

I am interested if there is a way to generate multiple independent Laravel Nova dashboards within the same multi-auth application?
Eg.
Administrator Dashboard - {admin.example.com/nova/users}
Member Dashboard = {example.com/nova/home}

Related

Dynamic resources in admin panel with Laravel Nova

I have a taxonomy system for a Laravel application I'm working on, as we needed more flexibility than the usual category/tag systems. Taxonomy models look something like this:
id
name
While the topic models look something like this:
id
taxonomy_id
name
description
Projects then have a many-to-many relationship with topics.
Now, the project is using Nova for the admin, and I've registered the Topic and Taxonomy models in the usual way, so from the admin one can create a Taxonomy, and then create Topics within that taxonomy. However, that's not exactly the behaviour I'd ideally want. I'd prefer it if I could define a Taxonomy, then have that taxonomy dynamically appear in the admin.
For example, if I create a new taxonomy in the admin called Sectors, I'd then see Sectors appear as a registered resource. These would still be Topic instances under the hood, but would be presented as Sectors. If I then created a Type of Work taxonomy, that would then be added dynamically as a registered resource too.
After digging through the Nova docs I haven't found a way to achieve this in the admin. Can anyone suggest a possible route to achieve this?

Documents on a rails website

I am developing a portal of sorts in Ruby on Rails using PostgreSQL.
I require different pages (each page represents a different topic of interest) on the portal to show different documents. The admin will have the ability to upload additional documents to each page.
No where is the entire list of documents on the website required
What is the best practice to implement such a system and is there any tutorials for the same?
It sounds like you want a content management system. Alchemy CMS is a good choice for rails.
That's a multi-tenant application, and normally you do this by associating all the records with a user or an account, sometimes both. This is done with a has_many/belongs_to pair most of the time for any records that are user or account specific.
You'll also have to be specific in each controller to only access records that the person can see, so you'll need to define an access control mechanism of some kind. There's modules for this, writing your own can be tricky.

Large Rails suite architecture: combine three apps into one container app

Our Rails suite is comprised of three independent Rails apps:
JSON API (Rails app)
Admin dashboard (Rails app)
Shared data models (Rails engine)
Both the API and Admin dashboard require the shared data models engine in their Gemfiles. All models and custom classes are stored in the engine, and both apps make heavy use of the shared components. The API lives on one Heroku server, and the Admin dashboard lives on another separate Heroku server (two separate Heroku apps). Each use their own respective Postgres databases. All three apps have their own GIT repos.
The API database stores information pertinent to our public users, and the Admin database stores mostly statistical information for admin eyes only.
A caveat of the setup is that the Admin dashboard app has direct access to the API database, and vice-versa. I understand that this is bad practice and may not seem to make sense, but there was a reason for this (mainly because the Admin dashboard needed to access all records of certain API tables, and the use of a custom API to communicate over the wire was not feasible). A similar reason exists for the API-to-Admin database communication.
This setup works for our purposes, nothing is broken, and resources are allocated efficiently. However, productivity is beginning to suffer due to the slow and uncomfortable development process. An example: a change to the API is required. Chances are that the shared models engine needs a change and therefore a feature branch is needed in both repos. After committing and pushing, the Admin dashboard now contains an old version of the models engine (is behind by one patch version). The problem lies in trying to coordinate all three Rails apps, when only one app needs a change. Another problem is migrations. Since the models engine contains two different database connections, I must create the migration once in the models engine then create it again in the appropriate app (API or Admin).
My ideal setup would involve one large Rails container app with separate engines contained within. The separate engines would be: API, Admin, Models. Also, I’m beginning to think that using only one database might make things easier. I would also like to keep the API on its own server instance, and the Admin on a separate server. The reason for this is that the API is public facing (communicates with a public iOS app) and the Admin is used mainly as a CMS and reporting engine.
I am looking for solutions and advice from experience managing similar Rails / Heroku architectures. Specific questions:
Should I attempt to combine the three Rails apps into one container
app and use the engine approach?
Should I attempt to combine the two
databases into one database?
Is it possible to have one Rails
container app, and allocate different servers to different engines?
If I should keep all apps separate, is their an easier and more
productive way to implement new features and fixes on a daily basis?

Can I use Devise for my multiple-store site with Ruby on Rails?

We're planning to develop a site which hosts multiple e-commerce stores. All the virtual stores share a database. (Kinda like shopify.com) So customers may think that the sites are separate. Customer emails are unique only within one vendor but not globally.
Is Devise suitable for such a site? If so, how? If now, can you recommend other options?
Thanks.
Sam

Multiple Projects in a single Rails Application for Heroku

I am working on an Application with Rails 3 and MongoDb which will be deployed on Heroku. The application will fetch data from several APIs on the web and then perform analytics to generate meaningful insights.
However I want to have several sub-projects in this application. For example :
Project 'P1' which performs analytics for a Company C1 and with a look and feel customized (for now different text will do with same styling) for the company. This project should be accessible on p1.domain.com
Project 'P2' which performs analytics for a Company C2 and with a look and feel (for now just different text with same styling) customized for the company. This project should be accessible on p2.domain.com
Is this possible with Heroku? How should I go about it?
Andrzej is probably right. Make it one application with routes to subdomains. Check out Ryan Bates Railscast on this topic http://railscasts.com/episodes/221-subdomains-in-rails-3.
Heroku allows subdomains as well, check out https://devcenter.heroku.com/articles/custom-domains. This is also answered by #jpwynn # https://stackoverflow.com/a/4872039/1792207.
T.

Resources