https://github.com/samuelmanzanera/clean-node-api
NodeJS web api using the clean architecture with DDD
https://github.com/samuelmanzanera/clean-node-api
architecture clean ddd hexagonal microservice nodejs onion
Last synced: 9 months ago
JSON representation
NodeJS web api using the clean architecture with DDD
- Host: GitHub
- URL: https://github.com/samuelmanzanera/clean-node-api
- Owner: samuelmanzanera
- License: mit
- Created: 2018-08-13T14:52:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-13T15:14:34.000Z (over 7 years ago)
- Last Synced: 2025-05-15T20:13:38.808Z (11 months ago)
- Topics: architecture, clean, ddd, hexagonal, microservice, nodejs, onion
- Language: JavaScript
- Size: 39.1 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clean-node-api
NodeJS web api using the clean architecture with DDD
## Architecture
The application follows the Uncle Bob "[Clean Architecture](https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html)" principles and project structure or [Hexagonal](http://alistair.cockburn.us/Hexagonal+architecture) or [Onion](https://www.infoq.com/news/2014/10/ddd-onion-architecture) architecture
The following can be used to structure microservices or to have clean startup for REST web api.
### Project structure
```
|app.js => Entry of point of the application
|--core => Business layer
|----domain => Domain model objects such as Entities, Aggregates, Value Objects, Business Events, etc.
|----useCases => Application business rules
|----exceptions => Application exceptions
|--adapters => Adapters and formatters for use cases and entities to external agency such as Database or the Web
|----controllers => Express controllers
|----middlewares => Express middlewares
|----repositories => Repository implementations
|----security => Security tools implementation (by example JsonWebToken)
|----serializers => Object converters
|--infrastructure
|----database => Database connection, ORM, Query builder, Schema
|----logger => Application looger
|----server => Express server definition
```
## Licence
MIT