I’m a beginner to Flutter and I’m still referring to tutorials so bear with me on that. I’m trying to make an app integrated with Firebase. Is it okay if I add all those queries and stuff within the app, or do I need to run a separate server like node and do those there? I’m acknowledging the security part as well, that’s why I’m asking this. I mean Firebase has those security keys etc. And not only the Firebase part I’m talking about security as well, but for other implementations that connects likewise (ex: security key) stuff putting inside flutter code as well.
Also if this is a duplicate, feel free to add it here. Because I didn’t find answer for this
Tried reading several articles but didn’t get the answer for the exact question
>Solution :
Is it okay if I add all those queries and stuff within the app, or do I need to run a separate server like node and do those there?
Yes, it makes perfect sense to add queries inside your application code as long as you need to interact with the Firebase products. For example, if you need to display a list of users, either from Firestore or from the Realtime Database, then you have to perform a query, get the result, and display it in Flutter, in a ListView for example. When it comes to security, you have to write security rules so you can allow only users that have permission to do that.
Moreover, if you want to run back-end code in response to events like user authentication, or any operation that takes place inside Firestore, Realtime Database, or Firebase Storage, then I recommend you use Cloud Functions for Firebase. Please note that all requests to the latter Firebase products that come from any backend SDK will bypass security rules entirely. Security rules only apply to mobile and web clients.