This is a Spring Boot application for fetching, caching, and converting currency exchange rates. It uses Redis for caching and provides a REST API for accessing the exchange rates and converting currencies.
-
Clone the Repository:
git clone https://github.com/lgsurith/spring-currency-convertor.git cd spring-currency-convertor
-
Ensure to have Java 17 installed or refer setup.
-
Build and run the application.
mvn spring-boot:run
- Install the Coding Pack for Java - here
- Install Java Extension Pack and Spring Boot Extension Pack from here.
- Setup the Redis Database either by downloading here or you can access it directly by Redis Cloud from here
- If you are using Redis Cloud , make sure to install Redis Insight from this link
-
Make sure to setup the dependencies as given in the list from Spring initializer or directly from the IDE.
* Spring Web * Spring Data Redis * Spring Boot Devtools * Spring WebFlux (Spring Reactive Web)
-
The given application must also be configured by
application.properties
in src/main/resources/application.propertiesspring.application.name=exchangerates #to setup external api configs. exchange.api.key = your_api_key exchange.api.url = https://v6.exchangerate-api.com/v6/ exchange.api.defaultcurrency = USD #spring redis setup spring.redis.host = your_redis_host spring.redis.port=your_redis_port spring.redis.username= your_redis_username spring.redis.password= your_redis_password spring.redis.ssl = true
Endpoint | Description |
---|---|
/api/exchange/rates |
Obtains Realtime Rates of listed currencies. |
/api/exchange/convert |
Converts any amount of currency to another using querying technique |