#Can you have one backend for two frontends? What is recommended?

9 messages · Page 1 of 1 (latest)

clear elbow
#

Hello! I'm currently, as a volunteer, building a project for a non-profit, I mostly have experience in frontend but I have taken one class in backend programming too, for this question I have no idea on anything so I'm just going to provide as much information as I can and if you have questions feel free to ask.

The idea is that the organization gives out free bags of food for people in need and they wanted to digitize the process by implementing an app.

So for the people that are picking up food I'm building an app in React Native for them to book time slots and such. For this I have a simple backend written in NodeJs using express as well as a simple postgreSQL database. I have not done much on the app so far.

And for the people working in the organization they need some kind of way to manage all the people and be able to check the information and such, since I've had a lot of experience in React before I decided to make a website in React where the workers can manage the people using the app.

Currently I've made these two parts separate, where each has it's own backend in NodeJs. I've been thinking however if it's more convenient to combine the two backends since they use the same database and such, I'm currently hosting it on neon.tech and it's free since it's pretty small so far, this can change in the future. I don't know what is recommended however or what is the "industry standard" like what is the normal way to do this? Is it normal to have two different backends for two frontends or to have one backend for two frontends that are kind of related?

TLDR / Google search question
Is it normal to have one backend for two frontends (i.e a mobile app and a website), I'm using: React Native, React, NodeJs, Prisma, PostgreSQL, Neon database hosting

This feels like a dumb question but I appreciate any answer

velvet pecan
#

Sounds very normal because they're two fundamentally different apps

#

It's very common to share a backend between different frontends for the same service (e.g. mobile app and web client) but here the two frontends are doing different things

#

I'd just go with a second backend for the management / employee tool, also saves you some complexity on authentication stuff

velvet pecan
clear elbow
velvet pecan
#

Depends on how you host but yeah

#

Could also run them on the same same on different ports or whatever

#

We used to have them on separate servers for better access control (in our case they were only accessible from the office network)