How seadmustafa/fxapi works
Project type and purpose
• This is a backend microservice: a Spring Boot–based REST API for currency conversion.
• It exposes endpoints for single conversions, bulk CSV conversions, exchange‐rate lookups, and conversion history.
• It fetches live rates from Fixer.io, caches them, and persists transaction history in an embedded H2 database.
File structure
• Top‐level artifacts:
• Dockerfile & docker-compose.yml (containerization, multi-container orchestration)
• pom.xml & Maven wrapper (build & dependency management)
• .env.local (external configuration for API keys)
• currencydata.csv (sample data for bulk processing)
• src/main/java/com/forex/api/:
• config (CacheConfig, ExternalApiConfig, OpenApiConfig)
• controller (three REST controllers)
• service & service/impl (business logic + caching layer)
• repository (Spring Data JPA for ConversionHistory)
• entity (ConversionHistory JPA entity)
• dto (request/response models)
• utils (FixerApiClient with @Retryable, UUIDGenerator)
• exception (global exception handling)
• src/main/resources: Spring profiles, OpenAPI banner, H2 console settings, sample images.
• Tests mirror controllers, services, and the Fixer client.
README for additional insights
• Clean layered architecture: external communication, caching, business logic, persistence, DTOs
• Uses Spring Retry for resilient external calls
• Swagger/OpenAPI docs for API exploration
• H2 console for runtime DB inspection
Elements
• Controllers (blue)
• Business services (green)
• External systems (orange)