Skip to content

Repository files navigation

Currency Service

"Archetype: service. Role: Manages currencies and exchange rates with external provider integration."

AGENTS.md

Build

Spring Boot microservice that automates exchange rate imports from the Federal Reserve Economic Data (FRED) API, delivering reliable currency and exchange rate data for Budget Analyzer.

Core Capabilities

  • Automated FRED imports - Daily scheduled imports with provider abstraction (details)
  • Currency series management - CRUD operations for exchange rate time series (API docs)
  • Historical rate queries - Date range filtering with Redis caching (80-95% hit rate)
  • Distributed coordination - Multi-pod safe scheduling with ShedLock
  • Event-driven architecture - Guaranteed delivery via transactional outbox + RabbitMQ

Quick Start

Prerequisites: JDK 25, Docker/Docker Compose

# 1. Start infrastructure
cd ../orchestration && tilt up

# 2. Export credentials and start the service
cd ../currency-service
export FRED_API_KEY=your_api_key_here
export SPRING_DATASOURCE_PASSWORD=your_db_password
export SPRING_RABBITMQ_PASSWORD=your_rabbitmq_password
export SPRING_DATA_REDIS_PASSWORD=your_redis_password
# See docs/local-development.md for full env var list (TLS, ports, etc.)
./gradlew bootRun

Dev server: http://localhost:8084 | Swagger UI: http://localhost:8084/swagger-ui.html

Technology Stack

Java 25, Spring Boot 3.x (Web, Data JPA, Modulith, Actuator), PostgreSQL, Redis, RabbitMQ, ShedLock, Flyway, SpringDoc OpenAPI, TestContainers + JUnit 5

Build and Test

./gradlew clean build
./gradlew test jacocoTestReport

JaCoCo coverage reports are written to build/reports/jacoco/test/html/index.html and build/reports/jacoco/test/jacocoTestReport.xml. check enforces the configured coverage gates.

Project Structure

currency-service/
├── src/main/java/              # Java source code
├── src/main/resources/
│   ├── application.yml
│   └── db/migration/           # Flyway migrations
├── src/test/java/              # Unit and integration tests
└── docs/                       # Detailed documentation

Documentation

Document Description
Local Development Running locally, environment variables, building, API access
Configuration Infrastructure dependencies, config properties, security
FRED Integration Data source, API key, provider architecture, import schedule
API Reference Endpoints, request/response examples, validation rules
Domain Model Entities, aggregates, domain events, business rules
Advanced Patterns Provider abstraction, ShedLock, Redis caching, messaging

Related Repositories

License

MIT

About

Spring Boot microservice providing currency management and exchange rate tracking

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages