admin管理员组文章数量:1323317
I have a scenario to implement in React. We have a pre-built admin panel with most of the functionalities like Auth, charts, analytics, user management etc already implemented. Now we are trying to attach it to another site as backend.
But the site is a web chat app with login feature where the user can e and manage his profile + chat history.
Admin panel and User Screen is totally different. both have an entirely different style guide and entirely different themes bought from theme forest.
We want to implement Role Based Auth so admin and user both enter using same login page.
Now I am confused about one thing.
- The Admin theme is heavy and full of charts and ponents
- User panel is fairly simple and lightweight.
My colleague wants to modify our already built admin theme, copy paste few ponents and add new bought theme inside it. but here I am seeing an issue. The project is going to have 2 themes and 2 assets.
I want to keep 2 themes running separately, redirecting to entirely different react app to launch admin or user panel. I want suggestions are this a bad practice or there's a better way to work around this issue
I have a scenario to implement in React. We have a pre-built admin panel with most of the functionalities like Auth, charts, analytics, user management etc already implemented. Now we are trying to attach it to another site as backend.
But the site is a web chat app with login feature where the user can e and manage his profile + chat history.
Admin panel and User Screen is totally different. both have an entirely different style guide and entirely different themes bought from theme forest.
We want to implement Role Based Auth so admin and user both enter using same login page.
Now I am confused about one thing.
- The Admin theme is heavy and full of charts and ponents
- User panel is fairly simple and lightweight.
My colleague wants to modify our already built admin theme, copy paste few ponents and add new bought theme inside it. but here I am seeing an issue. The project is going to have 2 themes and 2 assets.
I want to keep 2 themes running separately, redirecting to entirely different react app to launch admin or user panel. I want suggestions are this a bad practice or there's a better way to work around this issue
Share edited Mar 14, 2018 at 7:27 pranay patel 112 bronze badges asked Mar 14, 2018 at 7:16 Usman TahirUsman Tahir 2,6634 gold badges28 silver badges38 bronze badges1 Answer
Reset to default 8From what you are presenting us here I would go with your solution as well.
Basically speaking you should think about it as a separation of concerns, since both Panels will have different use cases and totally different dependencies.
But let's go through some of the points that make me think it would be best to split it up:
1. Payload for the user
If you inherit the whole Admin Panel and use just parts of it to render a totally different view out of it (by implementing another theme) you will automatically generate more data the user has to load before accessing his profile panel, which (eventually) influences the user experience.
2. Maintainability
By splitting up the different Panels you generate code that is less plicated and as a direct result of it gains a whole lot of maintainability, since bugs can be tracked way easier when you can look up a specific part directly instead of searching for it in a massive code-base.
3. Modularity
When thinking about SPAs modularity is key. This is even more important when you are writing a react
application. If I would be in your position I would modularize the whole profile and admin panel so you can easily reuse parts of it. This gives a boost to the maintainability as well, so that is a clear win-win situation.
4. Styling
I don't know which approach you are going, but I would say it is way easier to style ponents when they don't depend on each other. It is basically as you said: 2 themes mean 2 different style sets, so why should you go and bine these? It only makes it more plicated.
5. Security
When you split up the different panels you can easily separate data and APIs to prevent a data-leak between the two.
Long story short: I would go with your approach by splitting the 2 panels into seperate ponents (or even react
applications).
版权声明:本文标题:javascript - Two projects for Admin and User panel VS single app for both with different theme - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742143872a2422703.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论