Great to hear that you like it, Matt! It shares some elements and broadly the same layers as your Clean Architecture - with some specific differences for Firebase apps. I think both architectures would work great for Flutter development, and hope people will find them useful.
Finally, tutorials that focus on production-ready code/architecture. I wish more instructors talked about deploying with real world considerations. I'll be picking up your Udemy course for sure. Thank you for posting these videos!
The most summarized and easy to understand video with real example of how to arquitecto a Flutter app. I'm going to really use all this information, thanks! Greetings from Mexico City
This video was very much help. Was facing a problem accessing the uid down child pages for retrieving the subcollection database from Firestore for the last two days. Thank you!
Great Video Andrea. We need more high level videos on architecture and real software development, mostly in flutter when everything seems to be "speed ui" videos. If I can point out something about this architecture, is the fact that the dependencies are strongly coupled. Your models/business logic should not know about the api/data layer, and should use protocols (I think they do not exits on dart yet, so abstract classes ) to communicate with the data layer, that way they do not depend on concrete implementations of X or Y database/API. All that said, very good work. We need more people like you in the community.
Good observation. I have indeed used abstract classes for things like FirebaseDatabase or FirebaseAuthService before. In fairness, these are not strictly necessary when writing tests, because mocks can "implement" the concrete class directly. And modern IDEs have very good refactoring tools, that makes it easier to "swap" one implementation for another in the codebase. That said, I'm not against it and you can certainly do that if you like.
Brilliant video, I have used this setup in my apps and it's definitely secured my understanding of this architecture. This video is clean, but so incredibly clear and knowledge packed in just a short time. Thanks Andrea
Great video as always Andrea! In this App you prefer using StreamBuilder over StreamProvider despite the latter offers cleaner code. Also in the latest version of provider the use of .value constructor for creating new instances objects is not recommended as I quote:"To expose a newly created object, use the default constructor of a provider. Do not use the .value constructor if you want to create an object, or you may otherwise have undesired side-effects. "
I really love how you build your apps, I've been following your work for a hot second and I really like it. I have a question regarding the firestore database class that you have, It isn't better to use Firebase Function and expose those URL on the app so its more secure, rather than use a firebase database/firecloud dependencies? And how do you protect the google-services.json on the production ready app ?
If you're talking about putting a REST API wrapper in front of Firebase. I would not recommend that. You would lose on the best features of Firebase (efficient caching, realtime updates), without really gaining anything on security. I do not commit google-services.json to version control. And have it available as a secret inside CI (this can be done both with Github actions and Codemagic). I don't think it's worth it to download that file when the app starts for the sake of security - indeed the app will crash on start if the file is missing. Make sure you have good access rules in Firestore - that's more important.
Great suggestion. I would suggest making it more senior level by including: push notifications with FCM, continuous integration with codemagic, analytics, and finally more on software architecture.
Good day. I liked your lessons. Could you take a lesson on how to make a mobile application on the topic of ecology? For example, the application how to improve the ecology in the place where you live, having good habits, can be done in a playful way. Well, or something else. What do you think? It is on Flutter in the Dart language. After all, the topic of ecology is more relevant than ever, you will help a lot if you do a lesson
Believe it or not, I built this a few years ago: ecobuddyapp.com/ Gave up on the project. couldn’t run it for free & didn’t address the bigger problem. You can send me an email or DM if you want to find out more.
Works great, one thing I didn’t totally understand - where does uid in your main.dart come from? It's at the very top-level so I'm confused who supplies it. Thanks for your great tutorials!!!
I suggest you to try stacked, it is a great architecture created by FillesStacks and uses just like what you said which is great, some bonuses are there also 😉 I use it in my personal and clients projects btw
Andrea, I started my road to flutter 2 months ago, and took several courses, but I didn't realize your course was so closely tied to database access. I should have taken yours first as my primary app is very a rewrite of a client server app. Which of your courses should I take first?
I don't know if you still answer questions here but: 1: if you use a streambuilder and provide the stream right in the streambuilder, wouldn't a rebuild of this widget cause a new stream to be used and potentially cost new reads? and number 2: I used a similar structure but my firebase database file has 2000 lines of code. how do I split up a database class like that? thanks :)
Hi Andrea, great tutorial. I just started coding a month ago and in a rush to release an MVP. I’m stuck on choosing the right architecture as I’m starting to notice spaghetti code and it’s getting pretty messy, not sure which direction should I go. Should I be starting off with something that’s scalable? Or start off with something simple, if I start off with something more simple could I change it later down the track? Or would that be too difficult? Any help would be greatly appreciated
Great video and good explanation but i would like to ask this architecture works good with firebase but can we use it if we have Apis without streams then what can we use to have data continuity like firebase
You can use the same separation of layers. The service layer will contain Future-based APIs rather than streams, and you'll need to implement some UI (or a timer) to refresh the data. Alternatively use an implementation based on web sockets.
Hello, this is great! thank you! Quick question! How can I modify the login and register pages. For example, the login I can't change the button color and register I want to add an input field for first name.. I believe these are facebook plugins but wondering if there is a way to modify it???
I just bought your Udemy course and I'm very excited to take it. I have one quick question. Does the architecture you use in the course follow a specific pattern? For example, MVC, MVP, MVVM, or BLoC? Or is this something you developed on your own? Thanks!
If you take a look at the repository here: github.com/bizz84/starter_architecture_flutter_firebase The diagram seems to show a MVVM style approach but I could be wrong. From the looks of it, however, that makes the most sense to me based on how the information is displayed. Hope that helps.
Hi Andrea, thanks for the videos and all the sharing. (I also joined your Udemy course.) What do you think about riverpod (or provider) + hive + firestore? Do you think it's a meaningful approach? And would you consider creating a starter architecture for hive + firestore + riverpod / provider? I would absolutely join that kind of course also. Best regards,
Hi Andrea. I have asked again for this on other channels too(including yours), please can you include End to end encryption as a part of this course? There are a lot of ways to encrypt data on firestore, but none of them is ideal. I have tried lot of them. 1)using a locally stored string as the encryption key works, but what if the user logs in on another device, or factory reset his device? in this case all data is lost... 2)using users password works all well, but what if the user forgot or reset his password? in this case all data is lost... 3)add the Key in the User’s Google Account - this may also work, but again what if the user prefers another sign up method then google? 4)Use a service live Virgil E3Kit - Great approach but the free tier includes only 250 free users... and also Virgil is not a huge company, so if something goes wrong, all your data is encrypted forever. 5)Create an alternative server to store the key using Digital Ocean and Nodejs (mongo expres etc) - This may also work but takes lot of time to implement, and also if something goes wrong with the alternative server every user data is lost forever as it can't be decrypted anymore. Also you have to keep your ubuntu server up to date, making backups, and manually taking care about security 6) Google Cloud Key Management Service - Also works, bus very expensive and works only with google Auth. 7)Use UID as the encryption key. This works but again the key is stored side by side with the data so the Firebase admin can decrypt everything (The new Europe GDPR law, enforces you to protect and not collect personal data, or at least collect it with end to end encryption...). I am doing lot of research on this. I have also mentioned the same issue and the approaches i have tried on other youtube channels and started some conversations. All the best.
Hey! I used your architecture in my app. I got stuck at one thing. I want to show my users an onboarding if it's their first time logging in the app. I used authstatechages to show HomeScreen() and LoginScreen(). How do I show onboarding screen. As I can't have an asynchronous method (to check if user do exist) inside the data method on .when() methkd of streamProvider.
hello I saw your Udemy lectures of timetracker app . but the problem is that you fetch all your firestore data at once. which is not suitable for example for users Stream userStream() {
return _refrence.collection('users').snapshots().map((event) => event.docs.map((e) => UserDetails.fromJson(e.data())).toList()); } so can you make a video on Paginate data with query . it will be very helpful
I have Udemy business account given by my organization, but I could not find your course, it says "Course is not included in the Udemy for Business Content Collections" :'(
I know this app is small and we don't want to overengineer it but... accessing Services from UI widgets is definitely a red flag! This is no no no. Moreover, you don't want to do *any* logic from your UI classes. You should do it from corresponding ViewModels instead (ideally you'd need to create UseCase classes for that, as per CLEAN architecture by Uncle Bob, but that's another story). UI -> BLoC/ChangeNotifier -> Repositories -> Services/Data etc. That's even on your architecture scheme!
Another great architecture for Flutter apps 👏
Great to hear that you like it, Matt! It shares some elements and broadly the same layers as your Clean Architecture - with some specific differences for Firebase apps. I think both architectures would work great for Flutter development, and hope people will find them useful.
Andrea & Reso Coder, you both rock the flutter community! 👏
@@mychannel-cm1ce it's true!!!
Finally, found an instructor who cares about architecture rather than just features and ui.
Finally, tutorials that focus on production-ready code/architecture. I wish more instructors talked about deploying with real world considerations. I'll be picking up your Udemy course for sure. Thank you for posting these videos!
I subscribed at the end of the intro
Cant thank you enough for this valuable stuff!
thank you for making developers better
The most summarized and easy to understand video with real example of how to arquitecto a Flutter app. I'm going to really use all this information, thanks! Greetings from Mexico City
You are great man, thanks thanks for for helping us and sharing your code with us
This video was very much help. Was facing a problem accessing the uid down child pages for retrieving the subcollection database from Firestore for the last two days. Thank you!
Great Video Andrea. We need more high level videos on architecture and real software development, mostly in flutter when everything seems to be "speed ui" videos. If I can point out something about this architecture, is the fact that the dependencies are strongly coupled. Your models/business logic should not know about the api/data layer, and should use protocols (I think they do not exits on dart yet, so abstract classes ) to communicate with the data layer, that way they do not depend on concrete implementations of X or Y database/API.
All that said, very good work. We need more people like you in the community.
Good observation. I have indeed used abstract classes for things like FirebaseDatabase or FirebaseAuthService before. In fairness, these are not strictly necessary when writing tests, because mocks can "implement" the concrete class directly. And modern IDEs have very good refactoring tools, that makes it easier to "swap" one implementation for another in the codebase. That said, I'm not against it and you can certainly do that if you like.
Awesome. This help me organize my project better
one of the most important videos i have seen in quite some time
Brilliant video, I have used this setup in my apps and it's definitely secured my understanding of this architecture. This video is clean, but so incredibly clear and knowledge packed in just a short time. Thanks Andrea
Absolute gem of a video! Very hard to find but highly valuable information. Thanks!
Great work Andrea. You really help us understand concepts that are important to building scalable and efficient apps.
Awesome video Andrea!
I just added 3 of your courses to my Udemy wishlist! Hope to learn from you soon ✌🏼
Andrea, great idea of a video. However we would be much happier if this is continued as a video series:)
My main focus will be my new course in the coming weeks. But I definitely like talking about architecture ;)
At 16:40, you show a test for null on a variable that appears to be (by default) non-nullable
Please advise
This video was recorded before null safety
@@CodeWithAndrea good to know I was not missing something. Thank you
Great video and thank you for sharing the knowledge, Andrea.
Great video as always Andrea!
In this App you prefer using StreamBuilder over StreamProvider despite the latter offers cleaner code. Also in the latest version of provider the use of .value constructor for creating new instances objects is not recommended as I quote:"To expose a newly created object, use the default constructor of a provider. Do not use the .value constructor if you want to create an object, or you may otherwise have undesired side-effects.
"
I really love how you build your apps, I've been following your work for a hot second and I really like it.
I have a question regarding the firestore database class that you have, It isn't better to use Firebase Function and expose those URL on the app so its more secure, rather than use a firebase database/firecloud dependencies?
And how do you protect the google-services.json on the production ready app ?
If you're talking about putting a REST API wrapper in front of Firebase. I would not recommend that. You would lose on the best features of Firebase (efficient caching, realtime updates), without really gaining anything on security.
I do not commit google-services.json to version control. And have it available as a secret inside CI (this can be done both with Github actions and Codemagic). I don't think it's worth it to download that file when the app starts for the sake of security - indeed the app will crash on start if the file is missing. Make sure you have good access rules in Firestore - that's more important.
@@CodeWithAndrea thanks so much for the answer! I looking forward to more of your tutorials =)
I was just looking for this kind of vdo.....thanks mate!
You should make another Flutter course on #Udemy around another production-ready project.
Great suggestion. I would suggest making it more senior level by including: push notifications with FCM, continuous integration with codemagic, analytics, and finally more on software architecture.
Are you plan on creating such that course? It will be very helpful. Thanks
Bravo Andrea! 👏
Good day. I liked your lessons. Could you take a lesson on how to make a mobile application on the topic of ecology? For example, the application how to improve the ecology in the place where you live, having good habits, can be done in a playful way. Well, or something else. What do you think? It is on Flutter in the Dart language. After all, the topic of ecology is more relevant than ever, you will help a lot if you do a lesson
Believe it or not, I built this a few years ago:
ecobuddyapp.com/
Gave up on the project. couldn’t run it for free & didn’t address the bigger problem. You can send me an email or DM if you want to find out more.
Excellent tutorial....clear and concise
Thank you so much Andrea. You are a god of flutter ;)
Awesome!
Are you planning to make video about app localisation for multiple languages?
Works great, one thing I didn’t totally understand - where does uid in your main.dart come from? It's at the very top-level so I'm confused who supplies it. Thanks for your great tutorials!!!
Look at the AuthWidgetBuilder class. It's retrieved there, and passed back via the builder argument.
I suggest you to try stacked, it is a great architecture created by FillesStacks and uses just like what you said which is great, some bonuses are there also 😉
I use it in my personal and clients projects btw
Andrea, I started my road to flutter 2 months ago, and took several courses, but I didn't realize your course was so closely tied to database access. I should have taken yours first as my primary app is very a rewrite of a client server app. Which of your courses should I take first?
I don't know if you still answer questions here but:
1:
if you use a streambuilder and provide the stream right in the streambuilder, wouldn't a rebuild of this widget cause a new stream to be used and potentially cost new reads?
and number 2:
I used a similar structure but my firebase database file has 2000 lines of code. how do I split up a database class like that?
thanks :)
Hi Andrea, great tutorial. I just started coding a month ago and in a rush to release an MVP. I’m stuck on choosing the right architecture as I’m starting to notice spaghetti code and it’s getting pretty messy, not sure which direction should I go. Should I be starting off with something that’s scalable? Or start off with something simple, if I start off with something more simple could I change it later down the track? Or would that be too difficult? Any help would be greatly appreciated
Great video and good explanation but i would like to ask this architecture works good with firebase but can we use it if we have Apis without streams then what can we use to have data continuity like firebase
You can use the same separation of layers. The service layer will contain Future-based APIs rather than streams, and you'll need to implement some UI (or a timer) to refresh the data. Alternatively use an implementation based on web sockets.
Hi! Nice video. Just notice that Udemy's link in the video description is broken. Did you apply this architecture method in your Udemy course? Thanks
This is an evolution of what I used in the course where the same concepts are explained in more detail. The course uses Provider, not Riverpod.
Hello, this is great! thank you!
Quick question! How can I modify the login and register pages.
For example, the login I can't change the button color and register I want to add an input field for first name..
I believe these are facebook plugins but wondering if there is a way to modify it???
you can modify, I tried one but it's not easy, a lot code needs to change, hard to explain.
I just bought your Udemy course and I'm very excited to take it. I have one quick question. Does the architecture you use in the course follow a specific pattern? For example, MVC, MVP, MVVM, or BLoC? Or is this something you developed on your own? Thanks!
If you take a look at the repository here: github.com/bizz84/starter_architecture_flutter_firebase
The diagram seems to show a MVVM style approach but I could be wrong. From the looks of it, however, that makes the most sense to me based on how the information is displayed. Hope that helps.
Omg❤ I love itttttt
Any comments on ResoCoder's Clean Ar chitecture for Flutter?
Would you recommend this one for Firebase Apps?
This video was amazing. Thank you !
can you do a course for starter architecture for flutter with REST Apis.
Hi Andrea, thanks for the videos and all the sharing. (I also joined your Udemy course.) What do you think about riverpod (or provider) + hive + firestore? Do you think it's a meaningful approach? And would you consider creating a starter architecture for hive + firestore + riverpod / provider? I would absolutely join that kind of course also. Best regards,
Hi Andrea. I have asked again for this on other channels too(including yours), please can you include End to end encryption as a part of this course?
There are a lot of ways to encrypt data on firestore, but none of them is ideal. I have tried lot of them.
1)using a locally stored string as the encryption key works, but what if the user logs in on another device, or factory reset his device? in this case all data is lost...
2)using users password works all well, but what if the user forgot or reset his password? in this case all data is lost...
3)add the Key in the User’s Google Account - this may also work, but again what if the user prefers another sign up method then google?
4)Use a service live Virgil E3Kit - Great approach but the free tier includes only 250 free users... and also Virgil is not a huge company, so if something goes wrong, all your data is encrypted forever.
5)Create an alternative server to store the key using Digital Ocean and Nodejs (mongo expres etc) - This may also work but takes lot of time to implement, and also if something goes wrong with the alternative server every user data is lost forever as it can't be decrypted anymore. Also you have to keep your ubuntu server up to date, making backups, and manually taking care about security
6) Google Cloud Key Management Service - Also works, bus very expensive and works only with google Auth.
7)Use UID as the encryption key. This works but again the key is stored side by side with the data so the Firebase admin can decrypt everything (The new Europe GDPR law, enforces you to protect and not collect personal data, or at least collect it with end to end encryption...).
I am doing lot of research on this.
I have also mentioned the same issue and the approaches i have tried on other youtube channels and started some conversations.
All the best.
Hey! I used your architecture in my app. I got stuck at one thing. I want to show my users an onboarding if it's their first time logging in the app. I used authstatechages to show HomeScreen() and LoginScreen(). How do I show onboarding screen. As I can't have an asynchronous method (to check if user do exist) inside the data method on .when() methkd of streamProvider.
I have implemented this recently in the GitHub project: github.com/bizz84/starter_architecture_flutter_firebase
you are the best, thank you!
Thanks
hello I saw your Udemy lectures of timetracker app . but the problem is that you fetch all your firestore data at once. which is not suitable
for example for users
Stream userStream() {
return _refrence.collection('users').snapshots().map((event) =>
event.docs.map((e) => UserDetails.fromJson(e.data())).toList());
}
so can you make a video on Paginate data with query . it will be very helpful
Nice Dude!
Love it... What is the architecture name?
Starter architecture for Flutter & Firebase apps :D If you prefer you can replace "Starter" with "Stream-based"
I have Udemy business account given by my organization, but I could not find your course, it says "Course is not included in the Udemy for Business Content Collections" :'(
I have requested for my course to be included in the collection. Hopefully it will be added soon.
Thank you very much
om namah shivay💖✊🏻oMNS oMNS
how many days do you take to make one video?
I know this app is small and we don't want to overengineer it but... accessing Services from UI widgets is definitely a red flag! This is no no no.
Moreover, you don't want to do *any* logic from your UI classes. You should do it from corresponding ViewModels instead (ideally you'd need to create UseCase classes for that, as per CLEAN architecture by Uncle Bob, but that's another story).
UI -> BLoC/ChangeNotifier -> Repositories -> Services/Data etc.
That's even on your architecture scheme!
9999 views