Skip to content

A Spring Boot application providing a REST API for fetching, caching, and converting currency exchange rates. Utilizes Redis for efficient caching and supports conversion between multiple currencies.

License

Notifications You must be signed in to change notification settings

lgsurith/spring-currency-convertor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exchange Rates Application

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.

Architecture

image

Table of Contents

Installation

  • 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

Setup

  • 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

Configuration

  • 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.properties

    spring.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

Endpoints

Endpoint Description
/api/exchange/rates Obtains Realtime Rates of listed currencies.
/api/exchange/convert Converts any amount of currency to another using querying technique

Results

  • Getting Real time rates :

    image

  • Conversion of Currency Rates :

    image

  • Redis Cache DB :

    image

About

A Spring Boot application providing a REST API for fetching, caching, and converting currency exchange rates. Utilizes Redis for efficient caching and supports conversion between multiple currencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages