How lue93/api-fx works
FX is a Spring API for converting an amount between fiat currencies using current rates from Wise. The documented request workflow enters through the exchange controller, is coordinated by a use case, obtains a rate and calculates the converted amount, then returns the result. The sampled proxy service checks an in-memory cache and fetches missing or stale rates through the Wise client. The use-case implementation and some integration wiring were not sampled, so those links are based on the documented workflow and omitted where ownership is uncertain.
Main entry points: FiatExchangeController.java Exchange endpoint · FiatExcxhangeUseCase.java Exchange use case · ProxyRateService.java Cached rate lookup · WiseRateService.java Wise rate service
Components 19
API boundary
- Exchange endpoint
src/main/java/br/com/lue93/fx/adapters/controllers/FiatExchangeController.java - REST error mapping
src/main/java/br/com/lue93/fx/infra/spring/exception/RestControllerExceptionHandler.java - API documentation
src/main/java/br/com/lue93/fx/infra/spring/doc/SpringDocConfig.java
Application flow
- Exchange use case
src/main/java/br/com/lue93/fx/application/usecase/fiat/exchange/FiatExcxhangeUseCase.java - Amount conversion
src/main/java/br/com/lue93/fx/application/services/fiat/FiatExchangeServiceWiseRates.java
Currency domain
- Exchange contract
src/main/java/br/com/lue93/fx/domain/fiat/services/FiatExchangeService.java - Exchange data
src/main/java/br/com/lue93/fx/domain/fiat/vo/FiatInputData.java - Converted amount
src/main/java/br/com/lue93/fx/domain/fiat/vo/FiatOutputData.java - Currency symbols
src/main/java/br/com/lue93/fx/domain/fiat/entities/Symbol.java - Rate model
src/main/java/br/com/lue93/fx/domain/rate/entities/Rate.java - Rate request
src/main/java/br/com/lue93/fx/domain/rate/vo/RateInput.java - Rate result
src/main/java/br/com/lue93/fx/domain/rate/vo/RateOutPut.java - Rate contract
src/main/java/br/com/lue93/fx/domain/rate/services/RateService.java
Rate integration
- Cached rate lookup
src/main/java/br/com/lue93/fx/application/services/rate/ProxyRateService.java - In-memory rate cache
src/main/java/br/com/lue93/fx/domain/rate/entities/RateCache.java - Wise rate service
src/main/java/br/com/lue93/fx/application/services/rate/WiseRateService.java - Wise HTTP client
src/main/java/br/com/lue93/fx/domain/rate/services/FeignWiseClient.java
Other components
- API caller
- Wise service
Connections 12
- API caller → Exchange endpoint: submits exchange
- Exchange endpoint → Exchange use case: invokes
- Exchange use case → Amount conversion: calculates amount
- Exchange use case → Cached rate lookup: requests rate
- Amount conversion → Converted amount: returns result
- Cached rate lookup → In-memory rate cache: checks and updates
- Cached rate lookup → Wise rate service: fetches on miss or expiry
- Wise rate service → Wise HTTP client: requests rates
- Wise HTTP client → Wise service: fetches rate
- Wise rate service → Rate result: builds result
- Wise HTTP client → Rate model: receives rates
- Exchange endpoint → REST error mapping: errors handled by