Just a heads up... Megachat has been taken down temporarily because we exceeded the free limits of Firestore. This is a result of a user spamming writes to the DB, which has inspired a future video about preventing this type of issue.
@troykoss6 жыл бұрын
jerks
@kld00936 жыл бұрын
should i be happy or angry, I'm confused
@MaximYudayev5 жыл бұрын
Has that video come out already? Would love to see your solution if it is about change of the disabled parameter on user profile or something else
@baptiste64365 жыл бұрын
@@MaximYudayev I'd guess you'd just create an anti-spam function inside your code
@kevintlu5 жыл бұрын
Wait, why do you only have spark plan if you love firebase so much?
@delta4v6 жыл бұрын
The opening song of your video is always appealing that makes me enjoy video even more!
@PlanetComputer3 жыл бұрын
ghjk
@mvvbuch6 жыл бұрын
I’m building a chat app to play and learn firebase :) This is just in time to help :) Thanks
@zvikarp81496 жыл бұрын
Great video! Can't wait for a real-time Google maps + firestore tracking app.
@himself1875 жыл бұрын
just deploy more satelites in space, say thousands and thousands of them, then you will be good
@wobsoriano6 жыл бұрын
Awesome! Going to have a talk about firebase and will use this as my sample.
@zozo16036 жыл бұрын
Nice job, keep on going. I like how you build on earlier vids :)
@kumarvishalben6 жыл бұрын
The best channel on Firebase,,
@josephsteve086 жыл бұрын
i probably picked up a few tricks from this video! you're amazing!
@troythompson26 жыл бұрын
Another really solid video. Had to sign up for a pro membership. Thanks for all the hard work Jeff!
@jafar16076 жыл бұрын
as always.. brevity is what I like about your videos...
@christopherstock86706 жыл бұрын
Good work as always.
@ockenden4 жыл бұрын
This is a great solution. Lets face it, a doc for each message is a great way to do it, but 99% of the time you won't need the functionality you are missing out by doing it this way. I'm trying to solve a much bigger problem than this on my app across multiple chats and you've absolutely obliterated the problem and I THINK cut the costs of running my project. I would suggest that you use firebase to set your timestamp, doing it client side can cause all kinds of problems as a user can essentially insert chat messages anywhere they want if you're sorting with your client side timestamp. It would be great if like the other approach you could add an ID to each chat message, that way you could target that message for editing or read receipts. Then again, you could have another field in the doc for read receipts and just update it with a timestamp of when the doc was viewed, then every message that has a server timestamp after it will be marked as read! Just wondering, is it possible to get the file size of a doc in that cloud function? Rather than saying 'after 50 messages', you could just weigh the file and trigger the function if it's 5% off the limit or something? Also, you've now given me a super simple solution to pagination when that cloud function fires. You can just increment a backup doc by 1. Thank you for this, I've been contemplating how to resolve my issue for a while now and you've inspired a few new ideas!
@Xizor2316 жыл бұрын
This looks like a fun project!
@AbhishekKumar-mq1tt6 жыл бұрын
Thank u for this awesome video
@troykoss6 жыл бұрын
Great stuff as usual!
@rahulsawant55316 жыл бұрын
Great content as always. Thanks 😊👍
@rajneesh00456 жыл бұрын
Amazing content. Thanks a lot and Keep it up.
@jaytaylor90456 жыл бұрын
👍 Good work.
@patriciovargas38376 жыл бұрын
Honestly dude, I'm impressed with your channel and you website overall. Most of the tutorial out there just show how to do basic thins like a todo list, but you take it father and literally show us how to do things that we are going to be used in the real word. Thank so much!! I just did 4 tutorials of yours in the past 3 days and I know my money would be worth for buying the pro membership of your channel. Do you have any student discounts?
@samywat6 жыл бұрын
love your videos!
@morhodesly9106 жыл бұрын
Cool man. Thank you for the video
@will_abule6 жыл бұрын
I love this approach all my cloud function issue is fixed because of statement you made thanks men
@satheeshrouthu10986 жыл бұрын
Appreciate the valuable content!!
@salahalhaddabi48506 жыл бұрын
Thanks Jeff and very nice tips on rxjs especially when it comes to nested subscriptions 👍👍
@rohanmalik17726 жыл бұрын
This chanel is really awesome Thank you!
@siddhantkumar70366 жыл бұрын
Finally a good video on chat app...
@armandozabala6 жыл бұрын
The shirt is so great..
@jilblack16 жыл бұрын
great video, helpful tuto ty.
@RageBasterd6 жыл бұрын
you make it seem so easy.
@vikaskumar-im7im6 жыл бұрын
Thanks for the amazing content.
@aomo52936 жыл бұрын
HI, Very nice video: Thank you
@JoiAnnKhoo6 жыл бұрын
Thank you, Hope to see more video out related to bot chat, using state control to manage the workflow and notification for status update.
@__mayank6 жыл бұрын
This is exactly what I was looking for!
@PlanetComputer3 жыл бұрын
hgjk
@user-ot1dv6ri4f6 жыл бұрын
love these videos
@ajanieniola91726 жыл бұрын
Wonderful tutorial
@razakadam746 жыл бұрын
waaooow, my favorite channel on youtube
@gabrielgutierrez62826 жыл бұрын
Thanks for the app!
@garfiantodwicahyadi4136 жыл бұрын
Keep sharing jeff
@FarryEntertainment4 жыл бұрын
What about billing? This will create many document writes that will increase the cost of the bill?
@manunoly6 жыл бұрын
thanks jeff, time to build this chat!!!
@mehdinaghditam6 жыл бұрын
Thanks for the great tutorial!
@RITESHKUMAR-md8fg6 жыл бұрын
Ohh that's awesome 😮
@aravindmj37236 жыл бұрын
Hope to see more of this kind. Next time please reduce the speed.
@harpymaslow6 жыл бұрын
So exactly the video that I needed haha. Are you spying on me ? xD Great video. Thanks a lot
@PlanetComputer3 жыл бұрын
ghjk
@lemonplz6 жыл бұрын
Best intro yet
@77thoughts6 жыл бұрын
thanks man!!! You're awesome
@boogiedowngames68936 жыл бұрын
Just what I needed!
@PlanetComputer3 жыл бұрын
ghkj
@saravananr76816 жыл бұрын
every playlist of your video can connected one between one(little bit rxjs, firestore.....)!
@Fireship6 жыл бұрын
You can piece them together to build almost anything :)
@djanblom5 жыл бұрын
Really great video - thanks a lot :) Could you make a vid about Angular, Firestore and Signaling/PeerConnections(webRtc)?
@wobsoriano4 жыл бұрын
I hope we can get a video on firestore real-time with pagination combination.
@rajrathore41823 жыл бұрын
arrayUnion doesn't support servertimestamp. What approach do you suggest to add a reliable timestamp to each message?
@aidenlangley64395 жыл бұрын
Am I right in thinking that sub-collections would remove the document size constraint for this data model?
@narcodico6 жыл бұрын
Good shit!
@gautamsjain3 жыл бұрын
The issue with this approach is that partial documents aren't read in firebase. So each time the document is updated, the whole document will need to be downloaded for each user that is currently online and chatting. The network egress cost could be more or less equal to what this approach is trying to save. A possible solution for that would be to use this approach along with a webrtc based text chat. The currently online users will get updated p2p while the users that come later will load the last 100 messages in one lump sum document. I haven't tried this yet, so I am not sure what the cist diff would be. But it makes sense in my head. What do you think?
@davidlutta25036 жыл бұрын
I Love FireBase !!!
@Fireship6 жыл бұрын
Me too :)
@tomlemanh55066 жыл бұрын
Ayy new video!
@shashank53836 жыл бұрын
Thanks :) Can you make tut on Ionic chat app
@PureAlbania6 жыл бұрын
Getting my head around why didn't used the first approach. "the drawback you need to execute a document read for every message on the UI". Why don't just execute a query to get all messages. Even could limit with a Where case and get only the latest using a timestamp?
@themindstorm99476 жыл бұрын
Did you find an explanation for why he did not?
@KelvinWKiger5 жыл бұрын
Because precisely, with firestore you pay for each document read, not the query. In the first approach if you would execute a query to get all your messages, you would end up paying a read for each message because each one of them are in a separate document. Take time to read the billing documentation, best for you.
@KelvinWKiger5 жыл бұрын
How ever if go with the first approach, and use the _Where_ case to get only the latest message, you will be happy with this solution until your users *log out* and *log in* later willing to read back all the conversations they had.
@professorhuert78534 жыл бұрын
You gotta be careful using this structure because you also pay for egress traffic. Think about it: if the chat reaches 1MB (which it will if it's a very used chat app), then each new user will download 1MB. That'll quickly reach the GBs of download, which then becomes more expensive than paying for the individual reads/writes.
@aniketpriyadarshi28012 жыл бұрын
What copy pasting software do you use
@herantd5 жыл бұрын
Wish you could start making these videos with vue 😜
@OverAndOverAndOver4 жыл бұрын
Can SMS be implemented? How would this be done?
@darshangowda3096 жыл бұрын
Awesome video! I think the decrease in latency for cloud functions is because of the cold start ? And also, would it be economical to use firebase instead ? (only for the chat documents) Considering the union writes, reads from cloud function on every chat and then finally all the deletes!
@Fireship6 жыл бұрын
The latency has seemed exceptionally fast lately on several projects, even considering the cold start. RTDB could be more economical, but the total storage cost per GB is much higher, so it depends on your needs.
@okopyl3 жыл бұрын
Yo. Could you please record a video showing how to make a web app with WebSockets using Firebase only?
@DJNomadX5 жыл бұрын
how do you make is to that two users are connected based on a certain criteria?
@TheDPsoft6 жыл бұрын
Comment for the chance! Watching video right now
@TheCass2405 жыл бұрын
how would you check if a chat already exists between the two users?
@Joekay19566 жыл бұрын
Hi, I'm trying to rebuild your example, but can't deploy the cloud function to firebase, because of 'src/index.ts:45:18 - error TS2532: Object is possibly 'undefined'. 45 const data = change.after.data();' Why is it so? Thanks for answers. I'm really desperate about this problem. :( And great channel :)
@peppeneppe47266 жыл бұрын
Is it the normal case to save the chat messages unencrypted? I’m afraid that it will not fit the policies of data protection. I mean I could read some really private chats, if I just look at the database. Is it legal to do it this way? Serious question and thanks in advance!
@Jredivo6 жыл бұрын
Peppeneppe This is not a profession implementation. It’s more of a demonstration on how to create a basic chat through firebase.
@rubenheymans19886 жыл бұрын
Great content as usual, however it's a bit complicated, can you add references to the docs for the more advanced stuff?
@Fireship6 жыл бұрын
I hear you, the full writeup has links to the docs, but I would be happy to extend any specific parts you think need more details. angularfirebase.com/lessons/build-group-chat-with-firestore/
5 жыл бұрын
hi there, let think for a moment... what happens if you wan to storage the chat history and you wan to recover it, like a normal chat, what can i do?
@wilsonsfiso33105 жыл бұрын
no matter what I try, I cant get it to create a chat :( , would love to see your home component.... I've looked everywhere for it. much love from South Africa
@josephfouad35616 жыл бұрын
Something I can't understand about rejecting a subcollection or root collection data model, you said to avoid client read per message, but this will happen because every write with trigger a client read as you are listening to changes the document. Why not just make messages into their own collection , then listen to the query snapshot change on that collection? you may also limit the query to only the last document. Thanks
@Fireship6 жыл бұрын
I am not rejecting a sub-collection approach, just offering this as a possibility. The reads will only occur when the user is actively listening to the chat. In many cases, the user will be away then open a chat with N new messages, which can be fetched with 1 read.
@josephfouad35616 жыл бұрын
@@Fireship Ok, Thanks for the reply :)
@Shashank.Shinde6 жыл бұрын
I want this T-shirt
@andymonga58014 жыл бұрын
Luckily if you set the same document multiple times they don’t get updated by firestore !!!! Your condition if(charLen >= 10000 || msgLen >= maxLen) would trigger the cloud function forever and you would ruin us all ^^ With greater than or equal, this function is triggered twice. First time your condition is met with the upper limit maxLen , then it updates the doc. But all the other times msgLen equals maxLen and it would keep updating infinitely. As I said before, you are lucky here and firestore stops triggering at the second iteration because the docs are the same. You should use a strict comparison instead. if(charLen > 10000 || msgLen > maxLen)
@nikhiltalwar3186 жыл бұрын
Awesome !
@pheaktrakim12124 жыл бұрын
If I have something wrong hope you will help me !
@dusanjovanovski86056 жыл бұрын
I don’t agree how you structure data. Overall, good tutorial. Keep up great work
@KelvinWKiger5 жыл бұрын
Anything to propose instead?
@goodcareat6 жыл бұрын
your content is awesome! how to get a t-shirt? :)
@ishraq955 жыл бұрын
for me return { id: doc.payload.id, ...doc.payload.data() }; its not working.. some errors are showing..
@shahzadchaudhary5604 жыл бұрын
quick note: I don't think subcollections count against the parent document's size limitation. Can someone confirm this?
@alimodz62534 жыл бұрын
You are referring to your episodes by number but I can't see any numbers anywhere!!
@bantinggamer49626 жыл бұрын
you keep reference to different episodes but i have no idea how to find them.
@adnanmalik95433 жыл бұрын
Are you up for a video learning platom app/web app project? Basically Like Netflix
@adnanmalik95433 жыл бұрын
*platform
@vamankumarpatel26523 жыл бұрын
github code is not perfect when we do npm i then error is coming pls check. sir
@tweetydx99675 жыл бұрын
If only 1mgb can be stored for document, then how can we stored videos?
@roethermedia5 жыл бұрын
Videos should be stored in Firebase Storage. Just add the reference-URL of the video to the Firestore. Then you can access the video via the link in the database.
@sergioguerrero31176 жыл бұрын
Hi, sorry about my english, y try to use firesore but when send or recibe data firestore Is so slow and dont connect whit server AND use local copy , ¿ Can u help me?
@berdenpaul6 жыл бұрын
NICE!
@patrickmullot736 жыл бұрын
Hurray to Jeff and his Clone!
@Fireship6 жыл бұрын
Haha, was wondering if anyone would catch that
@r4jjin6 жыл бұрын
I need T shirt 🤗
@xit5 жыл бұрын
I wanna win async await tee.. Remembering good times.
@lobo22t6 жыл бұрын
Why firestore and not realtime database?
@josmbolomnyoi24986 жыл бұрын
its hard to learn without source codes..i will have to change channel now thanks in advance
@kunalr_ai6 жыл бұрын
Thanks for the episode but I couldn't get it
@gauthamgrao1456 жыл бұрын
Awesome
@camilotabares37786 жыл бұрын
Hi Just subscribe to you´re channel, will love to have the sticker
@pheaktrakim12124 жыл бұрын
Sent me this link please sir !
@amritgupta17926 жыл бұрын
Every thing best ...
@wavesforthemasses4 жыл бұрын
I feel that this approach is completely wrong for 2 reasons: 1) you are downloading all the messages over and over again at every update. Yes, you'll pay less money, but if the chat is really active, the user will need to download the whole document over and over again at every new message. This means he's downloading way more KB than he needs. Plus you are running a firestore cloud function that will increase your reads and writes..you'll at least double your reads. Anyway this problem with the cloud function could be fixed just checking the messages size on client side and letting the client automatically decide when to create a new archive document that will be populated by a cloud function (archive onCreate) with the old messages. 2) this chat is based on how much you trust people to not hack it. All the users in the chat will be allowed to update that messages field and removing everything or editing someone else messages. You cannot prevent this behavior. So this approach is not secure. SOLUTION If you want to keep your approach instead of having 1 field named messages containing an array of messages, you should have 2 fields (or more, based on the number of allowed members): messages_{firstUserID}: [messages] messages_{secondUserID}: [messages] AND another field named "allowed_members": allowed_members: [firstUserID, secondUserID] SECURITY RULES SIDE: this way you can prevent a member to update a field he shouldn't update. CLIENT SIDE: you download both fields (messages_{firstUserID} and messages_{secondUserID}) and combine them in a single array and sort by date. This is anyway still totally not secure because members can edit their own messages and change the submit date as they prefer. The subcollection approach is probably the only safe one right now.
@marshallvance67576 жыл бұрын
does anyone have a .json file of the database I can import. Thanks.