A currency conversion application built with Spring Boot and deployed to EC2
Service | Address |
---|---|
Spring Boot App | http://44.193.212.220:8080 |
Prometheus | http://44.193.212.220:9090 |
Grafana | http://44.193.212.220:3000 |
Requirement | Status | Additional comments |
---|---|---|
Basic UI | ✅ | Deployment URL - http://44.193.212.220:8080 |
REST endpoint with source , target , amount as params |
✅ | Example - /api/convert?source=EUR&target=USD&amount=100 |
Leverage ExchangeRates API | ✅ | https://exchangeratesapi.io/ |
Validation of input | ✅ | Validation Service |
Unit & Integration Tests | ✅ | Tests |
Cache responses from https://exchangerates.io | ✅ | Used Caffeine with TTL of 1 min |
Format result using Web i18n | ✅ | Class Method |
Server-Timing header in response | ✅ | ServerTimingAdvice.java |
CSRF and CSP | ✅ | Configuration |
Deployed to EC2 | ✅ | http://44.193.212.220:8080 |
Add instrumentation and forward to Grafana | ✅ | Dashboard ID: admin Password: admin |
http://44.193.212.220:8080/api/convert?source=eur&target=usd&amount=100.100
Param | Description |
---|---|
source | Currency to be converted from |
target | Currency to be converted to |
amount | Amount of currency to be converted |
Plain text response
Example - $118.17205399999999
Code | Description |
---|---|
400 | Invalid source , target or amount |
503 | Unable to fetch rates from third-party service for the given request params |
Note: Common currencies like USD, INR not supported as source by Exchange Rates service in Free tier
docker run -p 8080:8080 hiscodesmells/nosto-currency-converter:latest
Note: This command only runs the Spring Boot application
git clone https://github.com/hiscodesmells/currency-converter.git
cd currency-converter
docker-compose up
Service | Address |
---|---|
Spring Boot App | http://localhost:8080 |
Prometheus | http://localhost:9090 |
Grafana Dashboard | http://localhost:3000 |