I need to build a few (2-3) different systems (frontends), they will have different uses and users, however the data for all those systems is in 1 DB.
example: 1st system is a customer facing site 2nd system is a customer facing mobile app (android and ios) (similar to the site but can have different views/data) 3rd system is a backoffice app where admins can manage the customers
since the data is in 1 DB, i was planning to create 1 backend API to support all the frontends.
however the more i try to plan the authentication and authorization part (how the frontends will talk to the backend) it's getting too complicated.
I'm pushing for 1 backend api to prevent code/functionality duplication or differences issues, for example "edit customer" contains many steps and is possible via each frontend. i don't want to have 3 inconsistent versions of the same function.
did anyone have a similar need and found a good solution?
my main issue at the moment is how i protect certain functionality in each app, protect the api routes per user+frontend app.
I'm open to suggestions about which frontend technology to use, the backend is nodejs