How to build an app with admin panel when a client part of the SPA?

The application is written in Nodejs + React+Redux+MongoDb
How best do I build client and admin part of the application?

at the moment, the structure of the application without admin panel

the --dist
--src(react, app)

Since the admin panel is the difference from a client, wanted to make a separate folder, but how to make the express static folder is different depending on the part of the application? (admin panel or front end).
June 27th 19 at 15:24
2 answers
June 27th 19 at 15:26
How would I do that.
1. Using express to write a Restful API
2. Using React+Redux to write the admin panel, which communicates with the server via API
3. To put the admin on a subdomain
4. To develop a website on the same tools as admin (react+redux)
5. To give the website when accessing the root app (app.get('/', (req, res) => res.sendFile(path + '/public/index.html'));)

Correct me please if something is not explained to the person
A little unclear about the last paragraph. Those always give the person the same index.html? Just load different folder with the React-Redux app? - modesta_Medhurst21 commented on June 27th 19 at 15:29
Don't react to it index.html? Yes, one and the same. If you need SSR, then it is possible to connect - jamie_Gra commented on June 27th 19 at 15:32
June 27th 19 at 15:28
I'm not the best solution but option can be admin through a separate and it is necessary to consider access control, something like users to define groups. from the server you only need restapi. you're setit localStorage group of the current user and the token which comes from the server during login, now you can read some user now on the site and depending on this to render different. unable to make admin panel in a separate router and navbar if the user group admin to show a link to the village administration. here I was doing the role USER, ADMIN, MODERATOR, admin, can see maybe that will help
I also thought to do it, but the problem is that the entire authorization is built on steam (of a person comes only through steam account). And catching them for id and redirect also so-so solution, as the administrator need also to look beyond the outer part of the site with the ability to ban people (those roles are also on the client). - modesta_Medhurst21 commented on June 27th 19 at 15:31

Find more questions by tags Node.jsReact