Skip to content

AhmedSaladin/Sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean Architecture in Node.js

Click here for full blog post

Uncle Bob's famous Clean Architecture is a way to write resilient software.

Resilient software is divided into layers, underpinned by business logic and is independent of technologies. It should be:

  1. Independent of Frameworks. Libraries and frameworks should be treated as tools and not dependencies.
  2. Testable. Can be tested without external dependencies.
  3. Independent of UI. You can easily switch CLI for Web or RasberryPi.
  4. Independent of Database. Switch out SQL for MongoDB.
  5. Independent of any external agency. Business rules don't know anything about outside world.

The Clean Architecture diagram

In practice, choice of technology should be the last decision you make or code you write (e.g. database, platform, framework).

By following clean architecture, you can write software today that can be easily switched out for different technologies in the future.