NodeJS web api using the clean architecture with DDD
The application follows the Uncle Bob "Clean Architecture" principles and project structure or Hexagonal or Onion architecture
The following can be used to structure microservices or to have clean startup for REST web api.
|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
MIT