Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User and admin in the same app or separate

Tags:

reactjs

I have to do an app that has a part of users that manage all their things and another part of admin, and here come my questions:

  1. One App for both?
  2. One app for users and another app for admins?

a person experienced in react told me that if the admin is oneself, it is better to separate the administrator from the user's app because otherwise it becomes very heavy (I do not know if slow).

But thinking, I am the admin, but I have components in common with the users, I prefer to have an app for both.

It is very expensive? or can I do my administrative panel together with the login / registration and user front?

like image 270
Juan Pablo B Avatar asked May 13 '19 03:05

Juan Pablo B


2 Answers

Either option can work, if done correctly. In general, I would prefer to use the same application because it is simpler to maintain, particularly if the two applications share a lot of common code. However, there are some considerations which could tip the scales in favor of two distinct applications, mainly:

 1. It is easier to lock down a separate HR application to more than
    simply a login role.For example, the Employee app may be publicly 
    accessible via the
    internet, but the HR app could be locked down to the internal
    network, or even certain user's workstations.

 2. It would be much harder to brute force a valid login for the HR 
    app without having access to it.

 3. With a single app, it is possible for a developer to make a 
    mistake and accidentally expose admin functionality to regular 
    users. 
    This obviously would not happen with separate apps. (This is why 
    stressed "if done correctly" in the first sentence.)
like image 146
muzammal farid Avatar answered Nov 15 '22 11:11

muzammal farid


Yes sure you can keep the code for user and admin in the same app. It will surely increase the bundle size of your app and hence make it slow, but at the same time you can make use of lazy loading and chunking like techniques to make sure the performance of the app still remains well.

If your user side app is huge then to make things smoother you can go for separate admin.

like image 30
Raj Saraogi Avatar answered Nov 15 '22 11:11

Raj Saraogi