Can i create an app with React-native, firebase, and node js? - node.js

So i would like to have a react-native app and use all the cool features from firebase. Since I'm fairly new to firebase though, I'm curious if and how I could possibly install a nodejs environment -which should be hosted by firebase- to add some Api features. Thanks in advance

Firebase itself will not execute your Node.js code, but it has integrations with Cloud Functions and Cloud Run, which can be used precisely for that.
I recommend having a look at the documentation, specifically the pages on serving dynamic content and host microservices using Firebase Hosting.

Related

Deploying Node Js application with express framework in Supabase (Edge Functions)

I developed a node Js application integrated with some services like database, authentication from Supabase, It works fine and gave success results in local development for each routes when called from Postman. Now I want to deploy this application to make rest APIs for frontend. Supabase provides edge-functions. In their documentation they told it is an alternative for firebase functions. But I can't able to find any documentation or blog regarding deployment of node Js application. Is there any way to deploy this application like firebase functions on edge functions of Supabase Any clarification related docs or alternative solutions would be helpful.
Supabase edge functions run Deno application at the moment, which is a bit different from a node.js application, so your node.js application will not deploy directly to Supabase edge functions. You would have to rewrite your code to make it compatible with a Deno application.
Luckily, since typescript, the language used in Deno functions is a superset of javascript, so you should be able to reuse a lot of the code during the rewrite!

how to deploy an ionic-react app to mobile if I'm using node js server in the backend?

I discovered ionic this week and I'm really considering using it at work.
Basically, my goal is to build an app that will work on android and Ios, where the needed functionality is to connect to the cloud over web socket and pull data from the cloud and show it on my phone. Maybe later I'll eventually need to consider using login but not for now at least.
Normally, if I'm building a web app. I ll use nodejs to pull the data from the cloud and expose it to the frontend. I ll write all code together and I ll host my app in Heroku or something where the entry point is my nodejs server right? So that my server needs to start and it will take care of the rest.
This is a bit confusing in ionic since I need to start the app with ionic serve, but somehow I also need to start my nodejs server too right? So I assume I can't write the server-side code inside the ionic app or am I wrong?
There is not much about this on the internet but I did some research and I guess that I should deploy (host) my nodejs server in the cloud (maybe using Heroku) and then connect to the server from my mobile app over the socket. Is this the right/only way to do this? are there any security issues with this method?
I find ionic great but I'm not sure if I should use it at work. Sincerely, this use case of using a backend server with ionic made me confused.
Ionic looks ideal for building cross-platform apps that does not need server-side scripting, but how complex can it be if I want to integrate some server-side code in my app? especially as I said I'm going to use some login forms in the future to extend the functionality of my app.
PS: I'm using ionic 6.10.1 and specifically I'm interested in using ionic with react not with angular.
After some search, I discovered that it isn't possible to deploy the frontend and backend code together. Therefore the trick is to deploy the nodejs server separate from the frontend.
Precisely, if it is a web app, then you should deploy the nodejs server in a separate host from the frontend. Then by starting the frontend app, you can communicate with the running nodejs server via socket or REST API.
Hope this helps someone in the future :)

I found out that Firebase didn't work with the ejs file. What about DigitalOcean?

I've been using Firebase for a while but I realized this didn't work with an ejs file. If I have only one file which is an ejs file to host on an ACTUAL webpage, would DigitalOcean work with ejs?
It really depends on how you're trying to use EJS files.
Firebase Hosting is a static file host, which means that Firebase's servers don't do anything with the contents of your files. If you're trying to serve EJS files, so that they're rendered in the browser, then Firebase Hosting alone is already fine.
If you want the EJS to be rendered on the server, then that is not possible with just Firebase Hosting. But you can integrate Firebase Hosting with Cloud Functions or Cloud Run, which are essentially managed Node.js environments. And in that case you could run the EJS in Cloud Functions, which is hosted in Firebase Hosting.
For more on this, I highly recommend checking out the Firebase documentation on use-cases for hosting.
Note that all of these are probably also quite possible on Digital Ocean. Since you'd be using a VM there, you can essentially do whatever you want. The trade-off is that you'd lose the auto-scaling that Firebase offers there.
There is no reason to Firebase not work with EJS or even DigitalOcean. If you are integrating Firebase in front-end your problem is not back-end related.
digital ocean works for firebase if you using the front and for that

Google Cloud as server for node.js

I want to create a node.js with express application that can host multiple clients with different domain names.
I have never created such application, so my question is:
If I have a project on my computer and want google (or some other hosting) to run my node application, how do I do it? Do I need to zip the whole project, and transfer it to the host? If not, how do Google know the front-end and back-end code?
If you just want to deploy your code, App Engine is the best option for you.
You can deploy your code there, and Google will manage how many instances will you need. For NodeJS, you can see a quickstart that will show you how to start here. You can deploy different services and map those services with different domain names.
There are examples on App Engine if you are using Express, and a tutorial that will show you how to organize your front-end and back-end in App Engine.

Do Firebase Hosting only host static file / asset?

I am newbie in web development. And I am working on ember with firebase using emberfire.
As I found that I can deploy the ember project to Firebase hosting, do firebase hosting support asset hosting only? And I have to host my ember web project in another hosting?
Thanks a lot.
From the Firebase Hosting documentation:
Firebase Hosting provides fast and secure static hosting for your web app.
Embjer.js is a front-end only framework. Web applications built using Ember.js can be run on Firebase Hosting.
Give it a try and report back if you have a specific problem.
Ember requires NodeJS (npm) installed on your hosting to work. Firebase Hosting doesn't have anything like that.
Point of correction: Ember.js is a front-end tool like AngularJS, therefore you can use it with Firebase, which supports only static files hosting.
Firebase Hosting only stores assets (css, js and images files) and doesn't have any form of installing serverside packages.
fast forward to 2019, firebase now offers functions where you can write dynamic code for your static app. It uses node (express.js).
https://firebase.google.com/docs/functions/use-cases

Resources