This repository contains an example of hexagonal architecture.
- Clean Architecture by Uncle Bob.
- Onion Architecture.
- Separate infrastructure from business logic.
- Inputs and outputs in border the our design.
- Entities: Represent business objects.
- Interactors: Functions that interact with entities, business logic.
- Repositories: Interface operations with entities for example getbyId, getAll, save.
- Transport Layer: Communication methods, for example: http or SQS (Input andOutput).
- Data Sources: Class that implement the functions the repositories.
Project contains an example of hexagonal architecture
├─ src
│ ├─ controllers
│ │ └─ http
│ │ └─ PokemonController.ts
│ ├─ core
│ │ ├─ entities
│ │ │ └─ Pokemon.ts
│ │ ├─ interactors
│ │ │ ├─ index.ts
│ │ │ └─ pokemonInteractor.ts
│ │ └─ repositories
│ │ └─ pokemonRepository.ts
│ ├─ dataSources
│ │ ├─ PokemonDataSource.ts
│ │ └─ sequelize
│ │ ├─ index.ts
│ │ └─ PokemonModel.ts
│ └─ server
│ └─ index.ts
git clone https://github.com/sistemasnegros/api-hex-arch-express-types
node v14.17.6
Mysql
npm install
npm run dev
- @sistemasnegros - Idea & Initial work