when very new to Vuejs. there is designed a little online store and now want to implement the admin side where he client can add, edit stock items etc.
My question is simply that I need advice on the following:
Should I do this in the same app just using an admin route in router. If yes then should I create a second store (is this good practice)
should I do this in a separate app (possibly just an express app on the backend)
Solution :
Well it depends the business model and project roadmap. But can I can mention few things you can consider making the decision. I totally agree with other answer as well.
In my experience having the admin app as an separate app, reaped more benefits(NOTE: In My Experience, the might differ).
Benefits
Less overhead on the routing side. Meaning you don’t need to build special permission system on the router to only show what the user is aloud to see(Normal users now allowed to see admin related pages).
Adds a bit of reassurance to know that normal user might not stumble on admin pages which they not allowed to see.
If you want to make a change on the admin side only or vice versa, you only have to build/push production for one app. So eliminating potential stuff breaking on the other app you dont want to build/push.
Drawback
If both apps uses same components you either have to duplicate work done on them or have a component library which shares components between project(I created a component lib in my case, which help a lot later on when we needed to create additional apps)
If an user uses both apps, he have to switch between websites(In my this was trivial because users are most either just using the admin or just using the online shop app)
Cost of hosting an additional website.
Solution 2:
As with many things, I don’t think there is any right or wrong answer, and will mostly depend on the project and objectives. For me, the determining factor when deciding whether to extend a UI or separate it into its own project will mostly depend on the following factors:
How much overlap is there between the UI designs? If you need to re-use significant amounts of code/styling then keeping it as a single project makes sense.
What’s the scope of the additions? If the addition is very minor (a single page or two) then keeping it as a single project makes more sense, even if the overlap is minimal. However, if the scope is extensive with lots of different components and routes, separating the projects might be the better choice.
What’s the cost/benefit of time to develop the interface, vs time you (or others) will spend using it.
In the end, if it’s a full-fledged back-end you’re creating it’s often best to take the CMS approach and give it a dedicated backend styling, whereas if it’s just a few user preferences you need to toggle, then that might be overkill.