Skip to content

Commit c41c68d

Browse files
authored
font-size change
1 parent 3e74cd2 commit c41c68d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# node.js-clean-architecture
22
A use case of Clean Architecture in Node.js comprising of Express.js, MongoDB and Redis as the main (but replaceable) infrastructure.
33

4-
## Overview
4+
### Overview
55
This example is a simple RESTful API application in which a user can create / update / delete / find a post, by using the *Clean Architecture*.
66

77
The objective of *Clean Architecture* by [Robert C. Martin] is the separation of concerns in software.
88
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*.
99

1010
![](https://blog.cleancoder.com/uncle-bob/images/2012-08-13-the-clean-architecture/CleanArchitecture.jpg)
1111

12-
### Dependency Rule
12+
#### Dependency Rule
1313
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.
14-
### Entities
14+
#### Entities
1515
Contains all the business entities an application consists of. In our example the *User* and the *Post*.
16-
### Use Cases
16+
#### Use Cases
1717
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.
18-
### Interface Adapters
18+
#### Interface Adapters
1919
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.
20-
### Frameworks and Drivers
20+
#### Frameworks and Drivers
2121
The outermost layer is generally composed of frameworks and tools such as the Database, the Web Framework, etc.
22-
## How to run it
22+
### How to run it
2323
* Make sure you have [mongoDB] installed. At the terminal run the following command:
2424
```sh
2525
mongod --dbpath <path_to_data/db_folder>
@@ -34,16 +34,16 @@ npm run dev
3434
npm run start
3535
```
3636

37-
## How to run it (using Docker)
37+
### How to run it (using Docker)
3838
* Make sure you have [docker] installed. At the root folder run the following command:
3939
```sh
4040
docker-compose up -d
4141
```
42-
## API documentation
42+
### API documentation
4343
https://documenter.getpostman.com/view/1551953/TzCJgpnb
4444

4545

46-
## Further reading
46+
### Further reading
4747
- https://roystack.home.blog/2019/10/22/node-clean-architecture-deep-dive/
4848
- https://mannhowie.com/clean-architecture-node
4949

0 commit comments

Comments
 (0)