View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |

Plans for Cat.Api.Client

Typed API clients that call other services through the API gateway.
Status: not started. This plan collects what we know. The open questions need an answer before the build.

Contents

The idea

A service sometimes needs data or an action from another service, and it needs the answer to go on. The architecture says that call always goes through the API gateway. Writing a plain HttpClient call every time means repeating the same work: the address, the token, the error mapping and the retries.

Cat.Api.Client gives a typed client for that call. It returns an ICatResponse, like everything else in the toolkit, so a failed call looks like any other failed use case.

What we already know

From the root readme:

From the demo plan and the Aspire plan:

From the module conventions:

Decisions and open questions

Decided

Topic Decision
Route Calls go through the API gateway.
Result The client returns an ICatResponse.
Order of work The module is built from the working HttpClient code of Orders.
Aspire The module never references Aspire.

Open

Questions before building

  1. Should the module work equally well with shared Contracts and with the caller’s own models, and which one is the default?
  2. Should the client be generated from OpenAPI, or written by hand from a request type?
  3. Which token goes with the call by default?
  4. May the module assume the shared error shape of Cat.Minimal.Api on the other side?
  5. Where does retry live: ServiceDefaults, Cat.Resilience or this module?
  6. How does a client find the gateway outside Aspire?
  7. Do we need versioned APIs in the first version?
  8. Should the first release wait until Orders has used CatalogPriceProvider for a while, as the Aspire plan suggests?
  9. Is it enough for the module to cover GET and POST with JSON, or do we need file uploads and streaming?
  10. Do we also want a Cat.Api.Client flavor for the React client, or is that out of scope?