Date: 2019-07-01
Log date: 2019-11-04
Accepted
We need to expose the API of our application to the outside world. For now, we expect one client of our application - FrontEnd SPA application.
- Create one .NET Core MVC host application which contains all endpoints. This host application will have references to all business modules and communicates with them directly:
Host/API references:
Administration module
Meetings module
Payments module
User Access module
- Create one .NET Core MVC host application and multiple APIs projects per module. Each API project should have endpoints which are handled by particular business module:
Host references:
Administration API references Administration module
Meetings API references Meetings module
Payments API references Payments module
User Access API references User Access module
Solution 1.
Creating separate API projects for each module will add complexity and little value. Grouping endpoints for a particular business module in a special directory is enough. Another layer on top of the module is unnecessary.
- We will have only one API layer/module
- Each controller has responsibility to delegate Command/Query processing to appropriate module
- We don't need to scan other projects than host for controllers, routes and other MVC mechanisms
- API configuration is easier
- Overall complexity of API layer is lower
- Complexity of each controller is a little bit higher
- Build time will be shorter (less projects)