2

I am used to the MEAN solution stack for developing a web app and API, but I find Google Firebase more convenient to use because the database, storage, auth and hosting are all in one place.

I also like Firebase's real-time data synchronization which I badly needed with my app, and I really find it hard to implement in Node.js and MongoDB.

I am reading articles about Firebase but the more I read, the more confusing it gets. It seems like Firebase is an API as a service itself, so using it with Node.js looks ok.

Is there a proper way of using Firebase's components with a Node.js + Express.js server, because I still need Node.js features in my project?

I also think it doesn't make sense to do an HTTP POST or GET request to Node.js to save the data on Firebase when you can do it directly using Firebase's APIs.

Another reason I want the Node.js implementation is that I don't want to re-write my code for saving, editing or deleting for every app (web, android and ios) which so far is my understanding with Firebase approach.

Aryan Beezadhur
  • 4,503
  • 4
  • 21
  • 42
jofftiquez
  • 7,548
  • 10
  • 67
  • 121
  • I think when you use Firebase, you should get MongoDB away. Once I had a meetup where they demonstrated small micro blog written by nodejs and firebase, so I think it is possible. https://github.com/jerryjj/serverless-microblog – Sang Dang Aug 05 '16 at 06:32
  • I found another example, this guy use express and firebase in his project too https://github.com/pwmckenna/feedmixalot – Sang Dang Aug 05 '16 at 06:39

2 Answers2

3

Firebase can not run your app, it is a part of "serverless" trend that Google and other big asses like Amazon, Microsoft Azure are building. Firebase has intergraded too much useful features, but just storage, so basically you need to run your Express functions on other place, and connect to Firebase.

So yes, you still can use Express.js with Firebase but not same place. If you used Google Functions or Cloud Engine, it was another story.

I found this answer on SO: https://stackoverflow.com/a/30172451/1822805

Community
  • 1
  • 1
Sang Dang
  • 501
  • 1
  • 11
  • 26
  • What bothers me is the real time synchronization, will it still be 'real time' when the mobile apps are getting and putting data via the nodejs server? That really bothers me. – jofftiquez Aug 05 '16 at 08:14
  • 2
    As I remember, it does. When Jerry performed his simple blog, I posted something like "Oh, there are full of beers here" and it instantly displayed on his slideshow. (The meetup host gave us lot beer at that moment.) – Sang Dang Aug 05 '16 at 15:46
  • 1
    Hm Im sorry but can you check this as well? http://stackoverflow.com/questions/38793576/firebase-database-make-auth-uid-the-default-id-of-a-document Im still new to firebase so I have a lot of confusions. Thanks! – jofftiquez Aug 05 '16 at 16:08
3

Firebase Hosting allows you to use Cloud Functions to perform server-side processing. This means that you can support dynamic generation of content for your Firebase Hosting site. That means yes you can use EXPRESS with NODE in firebase functions.

Documentation

Prata
  • 1,250
  • 2
  • 16
  • 31