laravelfirebasereact-nativeapiscalability

What backend should I use for my react-native mobile application and Laravel portal which have to use the same database?


I am building a mobile application in react-native. I am using Firebase for authentication and I am using Firebase cloud functions with Firestore for some API functions that get information from the Firebase database and do some calculations with them before returning them to the app.

My client also wanted a web portal where things used in the app are managed by customers. I started building this portal in Laravel, which I wanted to run in Google Cloud Run later for scalability.

My question is, should I rather have the Laravel web portal communicate with the Firebase database or should I build an API into the portal where the mobile app communicates with, and why? Or is there any other way that would be cheaper or better for scalability?

Maybe important to note that I also need to have images uploaded in the portal that are used in the app, that has to be stored somewhere. Is it a good idea to store them in the Laravel projects storage while it runs in Google Cloud Run or will this be too expensive when scaling?

I hope someone can help me out because I am fairly new to scaling applications!

Thanks!


Solution

  • You can use REST Apis , but for authentication laravel uses Passport or Sanctum you are using firebase. Web portal builds in laravel may be in MySql. You can get web portal data by building larvael REST Apis. for file uploading you can use AWS. or simply move files to laravel storage dir. I suggest you to don't user Firebase if you wana make web portal , Only use Laravel and Mysql . then you need Apis for your App. Authentication goes there. and will be handled Via Passport or Sanctum.