Either solution works. If you want to write your servers with a language that includes features like null-safety and can be compiled as a native binary executable then go Shelf. Although I see this working well with lightweight serverless functions on GCP or similar. If you're one to use a lot of libraries then go NodeJS. I would assume there are better service integrations here too. You'll need to add TypeScript manually or get some boilerplate setup to have static type checking and null-safety support which is otherwise given freely with the Dart/Shelf combo.
I think you have a bug with concurrent websocket connections - the stream itself only allows a single listener, as you haven't classified it as a broadcast stream. This means that only the first listen() will have any effect. Presently this is ok, because you are appending the sockets for successive connections, but if you kill your first socket connection, the stream subscription will go down with it and none of the still-connected sockets will receive any updates. You're better off making it a broadcast stream and having a unique listen() per subscription in the websocket handler, then there is no need to manage the list of sockets within the router or to iterate over them within the handler.
Hey Paul, you make a valid point here. However this was a basic implementation of Web Sockets and I imagine people deferring to third-party solutions like Firebase/Amplify on prod. Still useful advice for anyone looking to go this approach.
Hi, could you please show me how to implement it? So far I have added .broadcast() in contacts_socket_screen.dart : "final _socketStream = StreamController.broadcast(); " How do I implement " a unique listen() per subscription in the websocket handler,"? thanks
Awesome Man.. Thanks for making such a great tutorial.. Also if possible pl. make a video on how different MongoDB with respect to Firebase in terms of features, architecture, and Price plans. Is MongoDB provides user authentication feature like Firebase?
Hey great tutorial. Can you provide information regarding schema in mongoDB in dart as mongoose package in nodejs. Is there any equivalent package or any other way to define Schema.
Thanks for your videos they helped me alot. I was trying to pass the websocket connection through the middleware implemented in static page tutorial but it give me error although its working with rest api requests correctly any advice?? thanks in advance 😊
Thanks for this video. I am new to MongoDB and I just know this tutorial is going to help me. My first problem is, how did you set up your docker-compose.yml? Was it manually written or generated?
@@CreativeBracket thank you for the reply i didnt try that cause somewhere in the documentation it said to not be used with flutter html but i found a better solution for my case i will just use google spreadsheet api
@@CreativeBracket my uncle rent cars for people and recently he noticed with other renters that the same person ruined rented cars or smthn. so the app just need to be able to save names of people and wat they did so they can blacklist them and not rent for them
The connection to the database happens on the serverside. Alternatively you can look into service accounts which allows permissions based access rather than username/password based access.
Super tutorial 🙌 You pretty much replace Firestore using this 😊 Also neat trick using Docker to set up a MongoDB 👍
Thanks for the kind words. I wouldn't say I've replaced the entire Firestore functionality though
@@CreativeBracket Haha, yeah maybe i exaggerated a bit, but still a very good job on the tutorial !
@@erlend1587 Sure thing, cheers
That was a pretty great video! Thank you!!
your tutorials really help me so much
Cheers mate, glad they do!
Second question, would you recommend using the Shelf server over a NodeJs server? If yes, why? If not, why?
Either solution works. If you want to write your servers with a language that includes features like null-safety and can be compiled as a native binary executable then go Shelf. Although I see this working well with lightweight serverless functions on GCP or similar.
If you're one to use a lot of libraries then go NodeJS. I would assume there are better service integrations here too. You'll need to add TypeScript manually or get some boilerplate setup to have static type checking and null-safety support which is otherwise given freely with the Dart/Shelf combo.
I think you have a bug with concurrent websocket connections - the stream itself only allows a single listener, as you haven't classified it as a broadcast stream. This means that only the first listen() will have any effect. Presently this is ok, because you are appending the sockets for successive connections, but if you kill your first socket connection, the stream subscription will go down with it and none of the still-connected sockets will receive any updates. You're better off making it a broadcast stream and having a unique listen() per subscription in the websocket handler, then there is no need to manage the list of sockets within the router or to iterate over them within the handler.
Hey Paul, you make a valid point here. However this was a basic implementation of Web Sockets and I imagine people deferring to third-party solutions like Firebase/Amplify on prod. Still useful advice for anyone looking to go this approach.
Hi, could you please show me how to implement it? So far I have added .broadcast() in contacts_socket_screen.dart : "final _socketStream = StreamController.broadcast(); " How do I implement " a unique listen() per subscription in the websocket handler,"? thanks
Can you please make an updated angulardart tutorial using angular_components?
Awesome Man.. Thanks for making such a great tutorial.. Also if possible pl. make a video on how different MongoDB with respect to Firebase in terms of features, architecture, and Price plans. Is MongoDB provides user authentication feature like Firebase?
Hey great tutorial. Can you provide information regarding schema in mongoDB in dart as mongoose package in nodejs. Is there any equivalent package or any other way to define Schema.
Thanks for your videos they helped me alot.
I was trying to pass the websocket connection through the middleware implemented in static page tutorial
but it give me error although its working with rest api requests correctly
any advice??
thanks in advance 😊
Great
Cheers
Thanks for this video. I am new to MongoDB and I just know this tutorial is going to help me. My first problem is, how did you set up your docker-compose.yml? Was it manually written or generated?
It was manually written. Check the Docker website on how to put one together yourself. It's quite powerful once you get the hang of it :)
hi Jermaine, great tutorial, Is there any way to deploy package(Flutter web api and dart backend) and serve it on my own server?
Yes you can. Check out my Heroku deployment tutorial
Good morning,
I create authentification flutter app but when i want to run it with chrome nothing happened.
Any advices.
Hi Jermainne. Thanks for this. One question - Is there a way I can integrate websockets if my MongoDB instance is on Altlas?
Sure, you just need to pass the Atlas connection string in the Db.create() instantiation. The other code stays the same.
@@CreativeBracket ALright. Thanks
How is possible mongo db change stream in flutteR?
Would you suggest Firebase or Mongo for using websockets for a chat feature in Flutter?
Firebase if you need a solution right now, although MongoDB are working on Realm Flutter due for release later this year.
is it possible to connect to atlas through the app without using a server ?
for my case i do not need the security
i wanna connect to the db directly
Have you tried instantiating a MongoDB connection and invoking the methods directly within the app? Only way to find out if it works :)
@@CreativeBracket thank you for the reply i didnt try that cause somewhere in the documentation it said to not be used with flutter html
but i found a better solution for my case i will just use google spreadsheet api
@@yesser6215 Ah right, it can't be used with flutter html that's why we need a server.
Out of curiousity, what are you building?
@@CreativeBracket my uncle rent cars for people and recently he noticed with other renters that the same person ruined rented cars or smthn. so the app just need to be able to save names of people and wat they did so they can blacklist them and not rent for them
hi, what is needed to execute the 'serve build/web' command?
Any of these two will do: pub.dev/packages/serve or www.npmjs.com/package/serve
dart server, mongodb, socket.io, webrtc, flutter - realtime communication application.
---Video Request---
why dont you do the refresh automatic ?
Can do
How can we secure the access id/password to the database? I don't want them to be visible to other developers in the code
The connection to the database happens on the serverside. Alternatively you can look into service accounts which allows permissions based access rather than username/password based access.
Morning Pls I have problem when i try to connect my physical device to mongo cloud db certificate verify failed
when i use emulator it is good
Which physical device are you using?
@@CreativeBracket Samsung galaxy Note 5
@@vadeltsague8241 Have you enabled internet access permissions in AndroidManifest.xml?
hi nice video can i request a grpc stream tutorial on flutter?
Ok, what are you building?
We need another update, but using Realm this time
Great idea!