This project is currently in progress and actively being developed. 🧑💻👨💻👨💻
A chat application made up with MERN stack in clean architecture
- Integrated google auth with Twilio for authentication and password login
- Integrated image upload with AWS S3 with CloudFront CDN
This project follows Uncle Bob's Clean Architecture principles to ensure a scalable, maintainable, and testable codebase. Clean Architecture promotes separation of concerns and emphasizes the independence of the business logic from the frameworks and external dependencies.
The objective of Clean Architecture by [Robert C. Martin] is the separation of concerns in software. This separation is achieved by dividing the software into layers. Each layer is encapsulated by a higher level layer and the way to communicate between the layers is with the Dependency Rule.
This rule says that nothing in an inner circle can know anything at all about something in an outer circle. The dependency direction is from the outside in. Meaning that the Entities layer is independent and the Frameworks & Drivers layer (Web, UI, DB etc.) depends on all the other layers.
Contains all the business entities an application consists of. In our example the User and the Post.
Contains application specific business rules. These use cases orchestrate the flow of data to and from the entities. In our example some of the use cases are: AddPost, AddUser, DeleteById etc.
This layer is a set of adapters (controllers, presenters, and gateways) that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the DB or the Web. In other words, is an entry and exit points to the Use Cases layer. In our example we implemented controllers and presenters together and these are the PostController and the UserController.
The outermost layer is generally composed of frameworks and tools such as the Database, the Web Framework, etc.
The key principles of Clean Architecture that we adhere to in this project include:
-
Separation of Concerns: The codebase is organized into distinct layers, with each layer having a clear responsibility and minimal coupling with other layers.
-
Dependency Rule: The dependencies between layers are arranged in a concentric manner, with inner layers containing the most abstract and business-centric code, and outer layers containing more concrete implementations and frameworks.
-
Isolation of Business Logic: The core business logic is decoupled from any specific frameworks or technologies, making it easier to test, maintain, and adapt to changes.