I follow the Layered architecture
Like this:
But with two differences:
I use Blazor Assembly for UI Layer.
I have
API layer
(REST) In between thepresentation layer
and theservice layer
.
My question is related to the Api design.
If I design the solution for HR system
and for example It has three modules:
- Recruitment.
- Performance Management.
- Time & Attendance.
and each module of these has sub-modules.
So I have two questions here.
- Should I create one API for the whole HR system with multiple areas or one API for each module of these or one API for each sub-module?
- Should I create another API for external usage (I mean one or more tailored for the
HR system
and another one for external systems likeProcurement system
for example) or just aligned with one? because when I asked about this some people said:
API endpoints must be UI agnostic. Tailoring APIs for some clients defeats the API ideas and purposes. The best design practices tell us to create APIs that express our backend store to the outside world regardless who is the outside world.
and others said It's totally fine to have two types of APIs the first for internal use in the solution and the other for interacting with other systems and this's so common when we use client frameworks like React or angular or blazor assembly
.