"Archetype: service. Role: Manages currencies and exchange rates with external provider integration."
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.
- 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
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 bootRunDev server: http://localhost:8084 | Swagger UI: http://localhost:8084/swagger-ui.html
Java 25, Spring Boot 3.x (Web, Data JPA, Modulith, Actuator), PostgreSQL, Redis, RabbitMQ, ShedLock, Flyway, SpringDoc OpenAPI, TestContainers + JUnit 5
./gradlew clean build
./gradlew test jacocoTestReportJaCoCo 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.
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
| 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 |
- Orchestration - Full system setup and infrastructure
- Service Common - Shared Spring platform and runtime libraries
- Session Gateway - OAuth2 session management
- Transaction Service - Multi-currency transactions
- Permission Service - Authorization (roles and permissions)
- Web Frontend - Browser client
MIT