The "Posts DDD" repository hosts a straightforward React application that fetches data from an API and displays it in a rudimentary fashion on the screen. The core aim of this repository is to demonstrate the application of Domain-Driven Design (DDD) principles to frontend code written in React.
This repository contains three different implementations, each situated in its own branch:
-
Branch
clean
: This branch attempts to adhere closely to the principles of Clean Architecture as described in Robert C. Martin's book of the same name. It's structured to reflect the separation of concerns and abstractions that align with DDD approaches. -
Branch
clean-inversify
: Following the same architecture as theclean
branch, this implementation leverages the Inversify library (Inversify.io) as an Inversion of Control (IoC) container to manage dependencies. -
Branch
main
: This architecture is a simplified variant that differs mainly in two aspects:- It does not rely on dependency injection and inversion; instead, modules are directly used where needed while still maintaining separation.
- Instead of organizing domain logic around "Use Cases," it is structured around "Services" which, in the author's opinion, are more readable and easier to use when composing different features.
To launch the application, you'll need to follow these steps on the respective branch:
- Install the dependencies:
npm install
- Start the development server:
npm run dev
Before running the application, make sure you have npm
installed on your system, which comes with Node.js. You can download and install Node.js from here.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
Distributed under the MIT License. See LICENSE.txt
for more information.
Juan Gómez - [email protected]
Project Link: https://github.com/gomezcabo/Posts-DDD