Facebook Clone using firebase.

Skip to first unread message

mrugank shah

Feb 4, 2014, 2:53:19 AM2/4/14
to fireba...@googlegroups.com

I am trying to build Facebook clone (kind off) using firebase. Still evaluating all the different options and technologies. My technology stack (on paper) looks as follows, all inputs are welcome and very much appreciated. 

1. Apps (iOS/Android/Windows) - Phone Gap
2. Web App 
3. Application Server - Google App Engine
4. Main Database - Firebase
5. Photo/Files - Google Cloud Storage
6. Push Notifications (Parse or Puship or pushwush - not decided yet)

I want to use Firebase for following things :-
1. User Authentication (Or should i be using GAE and then pass Firebase token ? )
2. Timeline updates of user (friends liking/commenting/posting pic etc. should automatically come on users timeline in real time)
3. Geo location based timeline ( what people around me are saying - it needs to be live updating query)
4. When a user comments/posts etc. it will sync with firebase and at this moment i need to process it for adding it to timeline of friends, add it to push notification queue (if we can call gae directly nothing like it), update some statistics data like total likes etc.
5. Would love to store photos also straight here but it will possibly not work for two reasons. 1. Cost and 2. processing image to make it more efficient (scale and quality).

Is #4 actually possible in firebase? I don't want to do it client side for obvious reasons. and sending data back and forth from firebase to GAE sounds kind of very inefficient and costly.


Trash Match

Feb 4, 2014, 2:54:44 PM2/4/14
to fireba...@googlegroups.com
I'm trying to do something similar, but not a social site.  And I'm also using GAE, Firebase backend, but I'm going to try to use a regular Google Drive account for pictures.  It's very easy to link to Google Drive and put an image into the page using an <img> tag.  I'm going to simply manipulate the <img> tag instead of making requests to the source by other means.  I'm not stating this is the best way, it's just what I'm looking in to at the moment.  I'm going to test it, and determine how well it works.  I'm going to authenticate users directly from GAE.  Since I'm serving the login page from GAE, I'd rather just try to keep data transmissions to a minimum and the most direct route.  But again, I'm just learning all this stuff, so I'm not making any claims to what is best or most secure.
Are you using a server side language?  PHP?  Java?  Python? etc?  Are you paying extra money for SSL?  GAE also has 5GB of free storage in the Blob.  Do you know about that?  Since what we are doing is so similar, I'm interested in sharing whatever knowledge and experience if possible.

mrugank shah

Feb 5, 2014, 5:36:06 AM2/5/14
to fireba...@googlegroups.com
Yes I am going to be using python, will need ssl and know about blob store. 
I am trying to make it in a way that it can be scaled to million users without much problem (famous last words ?). 
Since we are talking about GBs and GBs of photos will have to use google cloud storage or amazon s3 but will lean towards GCS since i am building on google stack and the cost is pretty much same now after the rate cut. 

Did you try using trigger.io? How is your experience with phone gap so far?

@firebase - firebase people i would really appreciate if you could help me on my initial query and of course i will be your customer for a long time :-)

Michael Wulf

Feb 5, 2014, 10:01:36 AM2/5/14
to fireba...@googlegroups.com
You may both want to have a close look at Firefeed, which is a twitter clone, but also a great launching point for a Facebook clone.

@mrugank: Everything you've mentioned here is perfectly possible and there are examples of most in the docs.

For image resizing and scaling, check out inkfilepicker, which uploads them to an S3 store, does cropping, sizing, etc for you. It's pretty much plug-and-play awesome.

You could, after upload, transfer them into Firebase if that's your desire, although I don't see any advantage to having the physical bytes in Firebase (images don't often change in real time so a URL in Firebase is probably just as good).


You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Trash Match

Feb 5, 2014, 2:53:07 PM2/5/14
to fireba...@googlegroups.com
I ran into a problem with angularjs not liking the key values in the data that Firebase assigns.  This group. My question on key values in Firebase.  I haven't even started with designing something for mobile apps.  I've only been learning web design for a few months now.

mrugank shah

Feb 5, 2014, 10:19:30 PM2/5/14
to fireba...@googlegroups.com
Hi Kato,

Thanks for the reply. 
Yes i did go through firefeed and some other examples and documentation. In firefeed all the updates like adding spark id to followers timeline or adding it to recent list etc is all done on client side which is fine for example but in real life i don't think it makes sense to do it on client side for many reasons (cost of bandwidth, loss of data in case client disconnects, time delay due to back and forth for no real reason, malicious user could post a spark without really updating it on his followers timeline etc). That should all happen behind the scene on server side. 
From what i can make out the only way to do it is watch firebase from application server (GAE in my case) and process data there and push it back to firebase as required. 
But even this approach wastes lot of bandwidth and processing time. I was hoping there was some kind of trigger you could set in firebase itself which would change other data (like adding spark id to followers timeline or adding it to recent list etc) whenever a spark was posted.  

Michael Wulf

Feb 5, 2014, 11:46:38 PM2/5/14
to fireba...@googlegroups.com
These all seem reasonable (the triggers sound like great fun; all in good time I'm sure).

I don't think the cost of bandwidth is different if you do this from a service or from the client (either still has to monitor and make the change). I don't imagine CPU time on the client could come into play here eithr, unless your client is sending hundreds of writes a minute (they'd need to be a pretty amazing typist). As for bandwidth, well once again, the bulk of this is likely to be the message itself, so adding a call to pass the ID to a couple additional paths is usually quite harmless.

You can enforce writing ids to places like the "recent" list by setting up a security rule that requires the ID to exist there before it may be written to the "spark" record. That's not to say there's never a case for a server process, but I think you'll find that you can get pretty far with security rules and client writes.

Reply all
Reply to author
0 new messages