+Kashif Minhaj Editors like VS Code do a decent job of guessing after a while, but intellisense still suffers a bit for sure. One option is to use Flow or Typescript along with an Editor that supports it so that you can specify the type of each parameter on the way in. No guessing.
If we use something like mongoose, should we make entities become mongoose schema? Or we should pass a entity to a function which creates and returns mongoose schema?
@@blackdiz2603 thanks for asking such a great question. Mongoose belongs to the outermost circle, so it would occupy the same role as our MongoDB Driver. Meaning, we would inject a Mongoose model into our CommentsDB module and use it exclusively to interact with the database. It's very important not to confuse a Mongoose model with a business Entity. We need to make sure that business rules are as independent as possible from third-party frameworks like Mongoose. A mistake I see too often in legacy code bases is that they built their Business Objects on top of - or even inside of - some third-party framework and then after a few years their codebase becomes an unstable mess because the underlying dependencies have been deprecated but no one wants to touch them because it would risk breaking all the (often poorly or not at all documented) business logic of their app. Clean Architecture was designed specifically to avoid this situation.
Do you think the upcoming class features (public/privates, getters, setters) will change this implementation at all? in the comment entity: export default (dependencies = {}) => class Comment { constructor(data = {}) { // code to validate and store the comment data in 'this' goes here } #author; #text; #replyToId; } in a use case: // instead of const comment = makeComment(info) const comment = new Comment(info) Also as a side note, it's really hard to find examples of people working with the clean architecture, in nodeJS, using more than just one entity. It would be super helpful if, for example, you changed the comment author to an Author entity and showed how you establish and validate things like many to one relationships at the business-logic entity level.
Love this part: To the client: "I've turbocharged our microservice by using a cloud-based AI" To a fellow programmer: "It's just an API that I'm calling..."
The whole "injecting" your dependencies instead of "importing" them was pure gold. I never understood why we would need to inject a dependency until now. Subscribed.
The inject is not the important part; the adapters and interfaces are the important part. He said the outer layers should depend on the inner layers, which means the external tools and frameworks should depend on our adapters and interfaces. The make-callback.js at the end of the video is a perfect example. Also, imported/required modules can still be mocked in tests. Injection with the wrapper function is not necessary and even adds bloat.
I think it is part of SOLID principals, in the D part, dependency inversion principals. where the high level module should not depend on low level module, those two must depend on abstraction. high level module is the code that we write ourself, and low level code is the dependency such as mongoose, node-postgres, mysql that 'abstracted' as db connector
@@fikriseptriananggara5922 you don't need to use an explicit "inject" pattern if the module being imported provides interfaces for any external modules it uses.
Yea 100%. I feel like when I was first introduced to NodeJS and didn't understand a single concept. How is your understanding now, 11 months later? Are you applying this architecture (honestly)? Or are you applying a different strategy? Monolith?
I think it's a little bit too late, but this is not about nodeJS, in particular this is about programming in general, these concepts could be applied within any other language, I mean, maybe just oop ones? I'm not really sure
@@Melvin420x12 I didn’t get chance to implement it as I am working on existing applications but I have kept in bucket whenever my new project will start I will be going to think on it
@@no-name2031 no you can apply these concepts to any type of programming language. Even in this video dependency inversion is achieved through functions. Whereas in pure Oop language there will be an intermediate interface.
OH, MY, GOD!!!! Friends (c) This is the ONLY ONE video which shows real ARCHITECTURE in REAL case! I have been searching a video like this one through years!!! Thanks a lot!!!
wow...me watching this 4 years later is the cleanest explanation of clean architecture and dependency injection I have come across. That's some solid content you've shared. Thanks mate :)
Hello Bill, I just wanted to thank you wholehearthly for this content. It really helped me to wrap my head around all this system design jargon and navigate through the plethora of clickbaity articles and videos. Have a great day.
This is the most helpful video I have watched about Clean Architecture. I can't count how many times I come back to watch this again and again every time I feel lost. Thanks so much!
Yes agreed, so much content that talks about clean architecture, but this actually shows it in action! And only now I’m starting to understand what it’s all about.
This video is a great example of what a video tutorial should be related to devs. Source code and diagrams. Business explanations, and concrete implementation. Absolutely the greatest
Mind = Blown. For someone who thought who knows enough about structuring code and model data and apis, this is an eye opener. This is proper pro content, at times I was falling behind because there was so much things to pick up. Please keep making videos. Thanks
probably the best video on Onion/Clean arch I've watched so far. Concrete examples helped so much. We have been trying to adhere to onion at work to make our lives easier down the road and I was second guessing myself sometimes. Thanks for clearing up the fog
First time a Node.js setup feels REALLY RIGHT! I love this. Especially the "mini-main" index.js files that do all the dependency injections for a small module. Great work!
One of the best video I've seen so far, finaly understood what dependency injection was used for. Hard to understand when you didn't studied IT and you convert to fullstack dev by yourself, now it's finally clearer. Thanks a lot. Subscribed of course.
This is a wonderful explanation, I haven't seen this type of clarity with concrete examples for clean architecture with node.js anywhere else. Nice work!
Love what you did with the video man, and also a very clever way to implement the adapter pattern for the sanitize library, the only thing that I would change, is that I prefer to have individual files for all the dependencies with their adapters, instead of having just one big file with all the third party and factory functions. But this video is a must see! thank you
Liked and subscribed. This architecture is the real meaning of plug and play. I love how each and every thing can be tweaked without affecting others. Loved it.
@Dev Mastery Fantastic balance of principles, application, and code details. Are you still making vids? (Or are you planning to start up again?) I would love a follow-up video that goes into some more deep-dive aspects of this practice. Perhaps also a video of common “gotchas” for people trying out this architecture for the first time.
This presentation gave me a very clear guideline on how to structure my current or future NodeJS - Express projects. I've found this tutorial accidentally after searching the web for something else (as usual) and I do NOT regret the 33:49 min that I spend to watch and try to understand it. I had to stop many time to get what you are saying and I saved it for later use. Great! Thx.
Thanks a million for this video!! I've read the Clean Architecture by Robert Martin, but could not understand how to apply the provided circular diagram in practice. Frankly speaking, I understand only 20-30% of what is going on in the video because of the lack of knowledge and experience, but it fires an awesome feeling of curiosity and desire to continue enhance my skills to become more and more professional as time goes by. UPD: I'm having so much emotions and insights watching this video so that I will download this video and keep it on my external drive for future reviews!! (if this video will accidentally disappear from RUclips)🙂
Thank you so much, it all makes so much more sense now. Clean Architecture is a difficult concept to grasp through, just because it has tricky parts such as "No inner circle depends on outer circle" and you're like: "Well, then how the hell am I going to insert a new object into the database if I cant depend on it? You explained it very well, thank you for that.
After watching this video I have only one question. Why I didn't know about your channel before? This video is a gold! Can't wait to see your other videos. Thank you very much for sharing your knowledge!
Thank you for creating these videos. Your insights are incredibly helpful and I hope you'll continue to expand on this topic in future videos. Coming from .Net Core and Entity Framework, I must say building REST APIs in Express looks like the wild west, in that everyone has their own structure and way of doing things. Whereas, implementing clean architecture in .Net with the Repository and Unit of Work patterns seems more straight forward. In the .Net world, two WebAPI projects built by different developers at least share some resemblance. Having gone through many tutorials, I can't really say the same for Express. But I guess that's the nature of unopinionated JavaScript frameworks. So, I'm now trying to find some kind of scalable structure to use in my Express projects. So far yours is the most logical I've seen, but it seems like TypeScript would simplify things quite a bit here. I'm interested in your thoughts on this.
@Ellie Maynard I agree. Virtually everyone has their own concept of how an Express or React project should be structured. There are very few standards in JavaScript compared to other languages. The approach shown in this video is an attempt to carry over architectural concepts that are more commonly found in C#/.Net and Java. I'm not saying it's bad, but you're correct that it's far from being a standard in the JavaScript community. While I applaud the idea, I really don't see this catching on anytime soon. Many JavaScript developers argue that moving in this direction is going back to the old OOP model they didn't like in languages like C# and Java because of all the boilerplate code necessary to get up and running. Plus, IMHO, to do this properly you'd really want to use TypeScript anyway. Not many bloggers or tutorials use a JavaScript "clean architecture" approach. I asked one prominent advocate (who promotes clean architecture along with domain-driven design or DDD) 'Why not go with ASP or Spring Boot in the first place?'. The reason he said was that he'd already built his startup on Express and later ran into maintainability issues as the project grew, so he borrowed enterprise development concepts popular in other languages and refactored his existing code base to accommodate these patterns. Because of his earlier struggles, he was now attempting to spread the word in the JavaScript community about the need for better design. I like what he's doing, but again, I don't see these patterns becoming the norm amongst JavaScript developers. As for me, I originally returned to Node (Express) because I got frustrated with all the boilerplate I was writing in ASP Core to build a basic REST API (albeit with repositories and a layered architecture like the one shown here). Express is great a first. However, it didn't take long before I was fighting to get popular third-party npm packages to play nice together without all kinds of hacks and workarounds. Having worked in software development for around two decades, the conclusion I came to is the Microsoft ecosystem is more mature and standardised. Microsoft's packages work together without a lot of hacking and compromise. So, I think it's worth the extra boilerplate code in the long run to go with ASP Core. (However, I might still choose Node if time and money were a constraint and I expected the structure of the program to change a lot. i.e. Node is better for the uncertainties of a startup but less suited to enterprise applications.) I continue to use React for my front-end, but I've switched to TypeScript. I still wish there was more consensus on how to structure a React application and how and when to sync state with the back end, rather than being left to fumble around and see what works. Again, unopinionated frameworks create a wild-west situation where everyone can argue their way is the correct way. Hence the reason why, as you said, no one's code seems to make sense until it's explained. People love to criticise PHP, but I suspect there are as many anti-patterns floating around in JavaScript projects these days as anything written in PHP. And while there are better, more organised Node frameworks than Express, Express is by far the most common Node framework you'll run into in tutorials or in the workplace.
Please please please keep continuing to make videos! Thank you so much. There are a few videos that help us to scale up to a high level. This is one of them that's why It is so valuable. Thank you again!
You're doing great work man. I find a lot of the conceptual stuff without practical examples so it's left up to me to experiment and I often get things wrong, but you've got some practical code as a practical example which is immensely helpful.
This video was outstanding in terms of depth and practicality it never felt express app until towards the end of the video. Although I understood the concept of clean architecture, but it would be really helpful if you make a playlist of achieving this from scratch. That would be gold! Thanks for such content. Subscribed
This was probably one of the best express - mongo setup I’ve ever seen. Thanks so much for sharing! Will probably have to rewatch, or clone the repo and step through a few times just solidify your implementation.
What a valuable video, contragulations! I have been working in a node.js app using Clean Architecture lately and it is great to see alignment with your solution... but specially being able to learn new things I hadn't thought about from it too, thank you for sharing!
I have been wanting something like this for so long! Many content creators out there doesn't give a flying fuck about how to architect and organize the code when working with Node, which leaves a lot of room for spaghetti code. Please continue doing videos like this!
Really impressive how you pass the knowledge in an easy way, real and understandable. Like some guys said, everything in only one video. Thanks for sharing
Where is our Dev Master, I want to consume more knowledge from your Wisdom, please comeback and continue to spread your word about architecture, clean code and more.....make a course or a book if is possible...take my money and gimme all you have :D
although i got lost in express callback, was really great video. i've always wondered that from college, i've learned the use case things but never knew how to actually use them. This video helps a lot of making sense of why we should learn software architecture. Thank you for makin such a wonderful video!
This type of learning material helps a lot, I am practicing clean architecture and this video helped clear some of the concepts. Thanks a lot you saved me a lot of research.
Any chance you could do a short tutorial series on how to use this approach from scratch? I can often do my own code form seeing others approach, but things don't always click with the order of how to put it together, and how it behaves until I see how it's done start to finish.
Makes perfect sense! Thanks! Also it would be so good if we had a bunch of checklist questions to go through about the architecture we decide to implement. Say: Q. What changes are required changing the db type itself? Could it be done better? Etc
Woah, I would love to see such example with NestJS (+TypeScript). I am junior dev and I couldnt understand everything from this video but I think I got concept which is incredibly good, but using it in my real life coding can be quite challenging. Sad that it was your last video on youtube since 2 years already, its probably not "most wanted" content because it doesn't focus on complete newbies, but nonetheless I'd like to see more vidoes of yours.
Definitively one of the best videos available on the subject, thanks for the content! I have a question if you don't mind answering. You wrote one controller for each action (get-comment, post-comment etc), but these controllers are also assuming the role of the presenter. The question is: Would this violate SRP? If you had a separated presenter method, your application could return a different format other than json, handle the exceptions output in different languages and you would have granular control of the response object in a single place. I find difficult to separate the controller from the presenter when the entry point is a Rest API as well, but it kinda of make sense if you think on the features it could provide, right? Thanks again!
Hey Bill, thank you for sharing your knowledge! The insights it's provided are invaluable and rather inspiring. 🙌 I wondered how should we structure our directory once we add-in more entities (e.g product, booking, meetings). Should we write all our use-case functions for our entities inside the main 'src/use-cases' folder or should we create a new '/src' folder with use-cases and controllers per entity? Or should each entity have its own API? 🚀 Please let me know if there's any way we can fund or support you (e.g. Patreon, Udemy). I do appreciate your knowledge. Thanks!
Clear, concise and well explained! Many thanks for this great video! I was searching for this kind of content applied to JavaScript in vain until now. Subscribed
Although, I'm coding on PHP primarily with Laravel, it was very interesting to look at the clear explanation of such an interesting concept. Love videos which are not for complete beginners. Actually, now I have a good conundrum on how to apply this type of architecture on Laravel. I think I'll read Uncle Bobs blog for better explanation. So, it would be nice if you would produce a video on how to use this architecture idependently on programming language or at least at some OOP lang (like Python, Java, PHP, C#, pretty much anything). It's just a bit complicated for me to read all the javascript here, although I had a good experience with it in front-end, node.js is not that clean, I could only figure out the shallow concept, not the deeper functionality and details of implementation. But, still, you've performed a really good work and produced a clean explanation. **Thank you a lot!** :)
I think you cannot use it with Laravel, cause it's a framework, so it dictates a way of handling the architecture (Laravel uses MVC), in this scenario it works cause it only use libraries, so the way or architecture the app relies on the author. So I think for you to apply this you need to move out laravel and use libraries to accomplish the same result. But I might be wrong and there is a way to achieve it with laravel, in my shot experience with both (Laravel and nodejs) I'll say it can't be done
Any questions about Clean Architecture, Node, Express, or Mongo? Let me know in the comments. I'm happy to help!
By injecting dependencies to function args, aren't we loosing out on intellisense?
Is there a better way to inject dependencies ?
+Kashif Minhaj Editors like VS Code do a decent job of guessing after a while, but intellisense still suffers a bit for sure. One option is to use Flow or Typescript along with an Editor that supports it so that you can specify the type of each parameter on the way in. No guessing.
If we use something like mongoose, should we make entities become mongoose schema? Or we should pass a entity to a function which creates and returns mongoose schema?
@@blackdiz2603 thanks for asking such a great question. Mongoose belongs to the outermost circle, so it would occupy the same role as our MongoDB Driver. Meaning, we would inject a Mongoose model into our CommentsDB module and use it exclusively to interact with the database. It's very important not to confuse a Mongoose model with a business Entity. We need to make sure that business rules are as independent as possible from third-party frameworks like Mongoose.
A mistake I see too often in legacy code bases is that they built their Business Objects on top of - or even inside of - some third-party framework and then after a few years their codebase becomes an unstable mess because the underlying dependencies have been deprecated but no one wants to touch them because it would risk breaking all the (often poorly or not at all documented) business logic of their app. Clean Architecture was designed specifically to avoid this situation.
Do you think the upcoming class features (public/privates, getters, setters) will change this implementation at all?
in the comment entity:
export default (dependencies = {}) => class Comment {
constructor(data = {}) {
// code to validate and store the comment data in 'this' goes here
}
#author;
#text;
#replyToId;
}
in a use case:
// instead of const comment = makeComment(info)
const comment = new Comment(info)
Also as a side note, it's really hard to find examples of people working with the clean architecture, in nodeJS, using more than just one entity. It would be super helpful if, for example, you changed the comment author to an Author entity and showed how you establish and validate things like many to one relationships at the business-logic entity level.
Love this part:
To the client: "I've turbocharged our microservice by using a cloud-based AI"
To a fellow programmer: "It's just an API that I'm calling..."
I had to pause the video right here, so true! haha
client: Will it have AI?
Me: Yes.
This is the most valuable nodejs video I’ve watched so far.
It is indeed one of its kind.
Agree
@@RaffaCaboFrioAgree!
Totally agree.
100% agree if only I'd have seen it a year ago 🤦♂️
The whole "injecting" your dependencies instead of "importing" them was pure gold. I never understood why we would need to inject a dependency until now. Subscribed.
I have been learning NestJS for a while, that framework highly uses this concept. You should try that out if you are a Node.js dev
@@tea_hanks1230 do you still use it?
The inject is not the important part; the adapters and interfaces are the important part. He said the outer layers should depend on the inner layers, which means the external tools and frameworks should depend on our adapters and interfaces. The make-callback.js at the end of the video is a perfect example.
Also, imported/required modules can still be mocked in tests. Injection with the wrapper function is not necessary and even adds bloat.
I think it is part of SOLID principals, in the D part, dependency inversion principals. where the high level module should not depend on low level module, those two must depend on abstraction. high level module is the code that we write ourself, and low level code is the dependency such as mongoose, node-postgres, mysql that 'abstracted' as db connector
@@fikriseptriananggara5922 you don't need to use an explicit "inject" pattern if the module being imported provides interfaces for any external modules it uses.
raise your hand if you feel you are a newbie in NodeJS after watching this video, thanks buddy for such knowledgeable tutorial.
Yea 100%. I feel like when I was first introduced to NodeJS and didn't understand a single concept. How is your understanding now, 11 months later? Are you applying this architecture (honestly)? Or are you applying a different strategy? Monolith?
I think it's a little bit too late, but this is not about nodeJS, in particular this is about programming in general, these concepts could be applied within any other language, I mean, maybe just oop ones? I'm not really sure
@@Melvin420x12 I didn’t get chance to implement it as I am working on existing applications but I have kept in bucket whenever my new project will start I will be going to think on it
@@no-name2031 no you can apply these concepts to any type of programming language. Even in this video dependency inversion is achieved through functions. Whereas in pure Oop language there will be an intermediate interface.
OH, MY, GOD!!!! Friends (c)
This is the ONLY ONE video which shows real ARCHITECTURE in REAL case! I have been searching a video like this one through years!!!
Thanks a lot!!!
I was about to write the same thing....
@@grzegorzg944 same lol.... years I've needed this
wow...me watching this 4 years later is the cleanest explanation of clean architecture and dependency injection I have come across. That's some solid content you've shared. Thanks mate :)
Thanks for this kind of videos. Most of the content creators just stand on the basics. I appreciate your pro content.
Hello Bill, I just wanted to thank you wholehearthly for this content. It really helped me to wrap my head around all this system design jargon and navigate through the plethora of clickbaity articles and videos.
Have a great day.
Best video on Clean Architecture I have come across till now. Thankyou so much!
This is the most helpful video I have watched about Clean Architecture. I can't count how many times I come back to watch this again and again every time I feel lost. Thanks so much!
I will be watching this several times until I understand more clearly. Great video!
Yes agreed, so much content that talks about clean architecture, but this actually shows it in action! And only now I’m starting to understand what it’s all about.
This video is a great example of what a video tutorial should be related to devs. Source code and diagrams. Business explanations, and concrete implementation. Absolutely the greatest
Mind = Blown. For someone who thought who knows enough about structuring code and model data and apis, this is an eye opener. This is proper pro content, at times I was falling behind because there was so much things to pick up. Please keep making videos. Thanks
Absolutely gorgeous! What clear and concise explanation! Please, please keep making DDD videos like this one. I've subscribed to your content.
Incredible! Best explanation of the Clean Architecture I've ever seen.
probably the best video on Onion/Clean arch I've watched so far. Concrete examples helped so much. We have been trying to adhere to onion at work to make our lives easier down the road and I was second guessing myself sometimes. Thanks for clearing up the fog
Great explanation! Not much channels out there focus on the architecture side of software development. More of these, please and thank you!
Please, don't stop making videos. You're a really good teacher
First time a Node.js setup feels REALLY RIGHT! I love this. Especially the "mini-main" index.js files that do all the dependency injections for a small module. Great work!
I'm a beginner developer and I'm so grateful to have found this channel. PURE GOLD! Thanks for this amazing content!
Both of your technical and teaching skills are remarkable. The best illustration of Clean architecture I've could find so far. Thanks sharing!
These are the kind of tutorials I have been looking for years and here I have got one. Keep making these kind of videos.
One of the best video I've seen so far, finaly understood what dependency injection was used for. Hard to understand when you didn't studied IT and you convert to fullstack dev by yourself, now it's finally clearer. Thanks a lot. Subscribed of course.
This is a wonderful explanation, I haven't seen this type of clarity with concrete examples for clean architecture with node.js anywhere else. Nice work!
Love what you did with the video man, and also a very clever way to implement the adapter pattern for the sanitize library, the only thing that I would change, is that I prefer to have individual files for all the dependencies with their adapters, instead of having just one big file with all the third party and factory functions. But this video is a must see! thank you
Liked and subscribed. This architecture is the real meaning of plug and play. I love how each and every thing can be tweaked without affecting others. Loved it.
This is one of the best tutorial I have ever watched. I hope this gets upgrade to typescript
@Dev Mastery Fantastic balance of principles, application, and code details.
Are you still making vids? (Or are you planning to start up again?)
I would love a follow-up video that goes into some more deep-dive aspects of this practice. Perhaps also a video of common “gotchas” for people trying out this architecture for the first time.
This is a really way to code in node, the use case break down into services is really intuitive
This video is so-o good. I've watched it twice. And the second time through I kept rewinding bits to make sure I didn't miss a thing!! Well done.
will do it too!
This presentation gave me a very clear guideline on how to structure my current or future NodeJS - Express projects. I've found this tutorial accidentally after searching the web for something else (as usual) and I do NOT regret the 33:49 min that I spend to watch and try to understand it. I had to stop many time to get what you are saying and I saved it for later use. Great! Thx.
Thanks a million for this video!! I've read the Clean Architecture by Robert Martin, but could not understand how to apply the provided circular diagram in practice. Frankly speaking, I understand only 20-30% of what is going on in the video because of the lack of knowledge and experience, but it fires an awesome feeling of curiosity and desire to continue enhance my skills to become more and more professional as time goes by.
UPD: I'm having so much emotions and insights watching this video so that I will download this video and keep it on my external drive for future reviews!! (if this video will accidentally disappear from RUclips)🙂
Thank you so much, it all makes so much more sense now.
Clean Architecture is a difficult concept to grasp through, just because it has tricky parts such as
"No inner circle depends on outer circle"
and you're like:
"Well, then how the hell am I going to insert a new object into the database if I cant depend on it?
You explained it very well, thank you for that.
Great content! I'd like to see a TypeScript project that uses this architecture to understand the use of interfaces
After watching this video I have only one question. Why I didn't know about your channel before? This video is a gold! Can't wait to see your other videos. Thank you very much for sharing your knowledge!
Thank you for creating these videos. Your insights are incredibly helpful and I hope you'll continue to expand on this topic in future videos. Coming from .Net Core and Entity Framework, I must say building REST APIs in Express looks like the wild west, in that everyone has their own structure and way of doing things. Whereas, implementing clean architecture in .Net with the Repository and Unit of Work patterns seems more straight forward. In the .Net world, two WebAPI projects built by different developers at least share some resemblance. Having gone through many tutorials, I can't really say the same for Express. But I guess that's the nature of unopinionated JavaScript frameworks. So, I'm now trying to find some kind of scalable structure to use in my Express projects. So far yours is the most logical I've seen, but it seems like TypeScript would simplify things quite a bit here. I'm interested in your thoughts on this.
@Ellie Maynard I agree. Virtually everyone has their own concept of how an Express or React project should be structured. There are very few standards in JavaScript compared to other languages. The approach shown in this video is an attempt to carry over architectural concepts that are more commonly found in C#/.Net and Java.
I'm not saying it's bad, but you're correct that it's far from being a standard in the JavaScript community. While I applaud the idea, I really don't see this catching on anytime soon. Many JavaScript developers argue that moving in this direction is going back to the old OOP model they didn't like in languages like C# and Java because of all the boilerplate code necessary to get up and running. Plus, IMHO, to do this properly you'd really want to use TypeScript anyway.
Not many bloggers or tutorials use a JavaScript "clean architecture" approach. I asked one prominent advocate (who promotes clean architecture along with domain-driven design or DDD) 'Why not go with ASP or Spring Boot in the first place?'. The reason he said was that he'd already built his startup on Express and later ran into maintainability issues as the project grew, so he borrowed enterprise development concepts popular in other languages and refactored his existing code base to accommodate these patterns. Because of his earlier struggles, he was now attempting to spread the word in the JavaScript community about the need for better design. I like what he's doing, but again, I don't see these patterns becoming the norm amongst JavaScript developers.
As for me, I originally returned to Node (Express) because I got frustrated with all the boilerplate I was writing in ASP Core to build a basic REST API (albeit with repositories and a layered architecture like the one shown here). Express is great a first. However, it didn't take long before I was fighting to get popular third-party npm packages to play nice together without all kinds of hacks and workarounds.
Having worked in software development for around two decades, the conclusion I came to is the Microsoft ecosystem is more mature and standardised. Microsoft's packages work together without a lot of hacking and compromise. So, I think it's worth the extra boilerplate code in the long run to go with ASP Core. (However, I might still choose Node if time and money were a constraint and I expected the structure of the program to change a lot. i.e. Node is better for the uncertainties of a startup but less suited to enterprise applications.)
I continue to use React for my front-end, but I've switched to TypeScript. I still wish there was more consensus on how to structure a React application and how and when to sync state with the back end, rather than being left to fumble around and see what works. Again, unopinionated frameworks create a wild-west situation where everyone can argue their way is the correct way. Hence the reason why, as you said, no one's code seems to make sense until it's explained.
People love to criticise PHP, but I suspect there are as many anti-patterns floating around in JavaScript projects these days as anything written in PHP. And while there are better, more organised Node frameworks than Express, Express is by far the most common Node framework you'll run into in tutorials or in the workplace.
I had to watch probably too many times, but thank you. This is the best programming video I have ever watched.
Out of the node js videos that I came across with, this is probably the best and most clean so far.
More about Microservices with Nodejs . Good content . Keep it up 🔥
I've stumbled to your channel by pure luck,it's probably the best node js vid i have ever seen, you should make more videos
Please please please keep continuing to make videos! Thank you so much. There are a few videos that help us to scale up to a high level. This is one of them that's why It is so valuable. Thank you again!
This should be the best Node video in the whole internet !
Seriously the best Node JS on RUclips ... Thank you sir!
This is so great. I love seeing how you implemented the Clean Architecture in JS! Very nice work, and thanks for sharing.
You're doing great work man. I find a lot of the conceptual stuff without practical examples so it's left up to me to experiment and I often get things wrong, but you've got some practical code as a practical example which is immensely helpful.
Thank you so much for making this! I've been reading about clean architecture and DDD for a while now and this finally made things click
Pure magic. This Arch is what we need to implement over MVC since change is an obvious
This video was outstanding in terms of depth and practicality it never felt express app until towards the end of the video.
Although I understood the concept of clean architecture, but it would be really helpful if you make a playlist of achieving this from scratch. That would be gold! Thanks for such content. Subscribed
Magnificent explanation supported by neat and potentially powerful app example! Thank you very much!
Really clean and testable code. Amazing! You went straight to the point, very good content. Subscribed!
TDD with Node.js Practical Examples: ruclips.net/p/PLvkjn9Z-S4IncPs9hbhnGULgSx43-Kakb
This was probably one of the best express - mongo setup I’ve ever seen. Thanks so much for sharing! Will probably have to rewatch, or clone the repo and step through a few times just solidify your implementation.
What a valuable video, contragulations!
I have been working in a node.js app using Clean Architecture lately and it is great to see alignment with your solution... but specially being able to learn new things I hadn't thought about from it too, thank you for sharing!
I have been wanting something like this for so long! Many content creators out there doesn't give a flying fuck about how to architect and organize the code when working with Node, which leaves a lot of room for spaghetti code. Please continue doing videos like this!
Sooooooooooo awesome. I'm trying to learn clean architecture and having this example in js is super helpful. Thanks for the great video.
Amazing video! More insightful content in this 33 mins than tons of other typing tutorials out there. Thank you very much!
Awesome video. Finally a real-case node js implementation with clean architecture! Very informative, thanks a lot!
Hands down the best demonstration of this concept.
This is gold! So many how to's but very very few why to's! Thank you for this!
Really impressive how you pass the knowledge in an easy way, real and understandable. Like some guys said, everything in only one video. Thanks for sharing
Thanks a lot. This is the most valuable architecture video I've ever seen.
Where is our Dev Master, I want to consume more knowledge from your Wisdom, please comeback and continue to spread your word about architecture, clean code and more.....make a course or a book if is possible...take my money and gimme all you have :D
this channel is a diamond in the dirt..soo underrated..need more content, please
i did find it extemely useful, thanks a million for the effort it took to compile and make this - much love
This video is an artifact of knowledge. It is so enlightening.
This is just amazing, and it even follows some functionnal programming principles... Wow
although i got lost in express callback, was really great video.
i've always wondered that from college, i've learned the use case things but never knew how to actually use them. This video helps a lot of making sense of why we should learn software architecture. Thank you for makin such a wonderful video!
Great Video! Always wanted to understand how to implement dependency injection on a practical use case.
The most valuble Nodejs video in RUclips
Finally, a real Design Patterns in JavaScript example.
Why does he stopped making videos, he's a truly genius. 😭😭
Excellent! One of very few non trivial code examples; demonstrating clean architecture and good coding style very well
This type of learning material helps a lot, I am practicing clean architecture and this video helped clear some of the concepts. Thanks a lot you saved me a lot of research.
Any chance you could do a short tutorial series on how to use this approach from scratch? I can often do my own code form seeing others approach, but things don't always click with the order of how to put it together, and how it behaves until I see how it's done start to finish.
You and me both, TechSpectrum. :-/
Same here.
youtube should have a MEGA LIKE BUTTON FOR THIS ALONE
im 1 second in and im hooked with that presentation of the sprinking in
Priceless content.
Thank you
Makes perfect sense! Thanks!
Also it would be so good if we had a bunch of checklist questions to go through about the architecture we decide to implement.
Say:
Q. What changes are required changing the db type itself? Could it be done better?
Etc
How to implement the clean-architecture of Uncle Bob in Javascript/Node.js/MongoDB was a problem that I struggle since a month. Thank you!
Thank you for this video! Finally one which explain in a better way with code example! 🔥👋
Woah, I would love to see such example with NestJS (+TypeScript). I am junior dev and I couldnt understand everything from this video but I think I got concept which is incredibly good, but using it in my real life coding can be quite challenging. Sad that it was your last video on youtube since 2 years already, its probably not "most wanted" content because it doesn't focus on complete newbies, but nonetheless I'd like to see more vidoes of yours.
This is incredible 👌 Whole new way of thinking (for me) 🤓
The video is definitely a gold. Thank you very much. I may apply the idea in our project.
Definitively one of the best videos available on the subject, thanks for the content! I have a question if you don't mind answering. You wrote one controller for each action (get-comment, post-comment etc), but these controllers are also assuming the role of the presenter. The question is: Would this violate SRP? If you had a separated presenter method, your application could return a different format other than json, handle the exceptions output in different languages and you would have granular control of the response object in a single place. I find difficult to separate the controller from the presenter when the entry point is a Rest API as well, but it kinda of make sense if you think on the features it could provide, right? Thanks again!
Yeah but that's too much and too many files already
Hey Bill, thank you for sharing your knowledge! The insights it's provided are invaluable and rather inspiring. 🙌
I wondered how should we structure our directory once we add-in more entities (e.g product, booking, meetings). Should we write all our use-case functions for our entities inside the main 'src/use-cases' folder or should we create a new '/src' folder with use-cases and controllers per entity? Or should each entity have its own API? 🚀
Please let me know if there's any way we can fund or support you (e.g. Patreon, Udemy). I do appreciate your knowledge.
Thanks!
I would second this question, and are you creating a completely seperate microservice and use rest or a events to communicate between the two?
Bill. You are my God send! Thank you!
Clear, concise and well explained! Many thanks for this great video! I was searching for this kind of content applied to JavaScript in vain until now. Subscribed
Great video! I'd love to see this re-written in Typescript, where you can take advantage of interfaces and factory classes.
Amazing! This video has really made me to reiterate a lot of my design principles. Thank you
What a great explanation. Loved how you explained the concepts in about half an hour! Subscribing!
Excellent video, Bill. This content is super helpful. I can't wait to try these concepts out to build a sturdy API. Thank you!
I just founded this. Thank you very much, this is advanced but at the same time so we'll explained that is just beautiful
You are the best. I wish you will come back soon. I'm missing your videos :(
Thanks a bunch. For someone with a C# background, this makes total sense. Doing it with type script will make it way better 😁
So simple and to the point.. Really a pleasure to follow.
Thanks for practically showing factory pattern
that was exactly what I needed. I always knew that something is wrong with my programming style
Very well explained, I used clean architecture in Android developers but didn't know I could use it on the web too!
One word... 'FANTASTIC!!!'
Although, I'm coding on PHP primarily with Laravel, it was very interesting to look at the clear explanation of such an interesting concept. Love videos which are not for complete beginners. Actually, now I have a good conundrum on how to apply this type of architecture on Laravel. I think I'll read Uncle Bobs blog for better explanation.
So, it would be nice if you would produce a video on how to use this architecture idependently on programming language or at least at some OOP lang (like Python, Java, PHP, C#, pretty much anything). It's just a bit complicated for me to read all the javascript here, although I had a good experience with it in front-end, node.js is not that clean, I could only figure out the shallow concept, not the deeper functionality and details of implementation.
But, still, you've performed a really good work and produced a clean explanation. **Thank you a lot!** :)
I think you cannot use it with Laravel, cause it's a framework, so it dictates a way of handling the architecture (Laravel uses MVC), in this scenario it works cause it only use libraries, so the way or architecture the app relies on the author. So I think for you to apply this you need to move out laravel and use libraries to accomplish the same result. But I might be wrong and there is a way to achieve it with laravel, in my shot experience with both (Laravel and nodejs) I'll say it can't be done
great video, examples and explanations. It's sad that it's the last video on the channel, hope everything's alright with you :(