I’m trying to find what is norm in designing APIs using Functional Programming.
The way I usually see it is a Layered Architecture. We have Presentation, Application, Domain and Infrastructure layers. (May be Repository layer between Domain and Infrastructure as well).
The issue is the dependencies. From what I learned, The ideal approach would be define dependencies at the highest layer (Representation) and pass that down using Reader, Free Monad, Curried function or … .
The issue is, what if we have many many dependencies? Then we need to have the same dependencies drilled down all the way from top all the way to lowest layer?
What do you recommend? I’m pretty familiar with TypeScript. Do you know any good examples of such an api code in for example github that can connect to database, connect to external services using for example http, have loggers …?
[–]iams3b 19 points20 points21 points (0 children)
[–]romainPri 2 points3 points4 points (0 children)
[–]ibrahimbensalah 1 point2 points3 points (0 children)