This project is a Spring Boot application for handling currency conversion rates.
- Java 17 or later
- Maven
- Docker
###Build the Docker Image
Make sure you are in the project's root directory.
docker build -t bank-conversion-rates:latest .
docker run -p 8080:8080 bank-conversion-rates:latest
The application will be accessible at http://localhost:8080.
- Open IntelliJ IDEA.
- Click on
File
->Open
and select the project folder. - Wait for IntelliJ to import the project.
- Navigate to BankConversionRatesApplication class in
src/main/java/org/bank/conversion/rates
. - Right-click on the class and choose
BankConversionRatesApplication
.
-
Open a terminal.
-
Navigate to the
BankConversionRates
directory in your project.cd /path/to/BankConversionRates
-
Parameter -p stands for path to the project
./start_bcr.sh -p <path/to/BankConversionRates>
example: ./start_bcr.sh -p /home/branislavmalo
Retrieves the actual conversion rates.
curl --location --request GET 'http://localhost:8080/actual-rates/show-rates'
Converts an amount from one currency to another.
curl --location --request POST 'http://localhost:8080/rate-conversion/convert' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 100.0,
"sourceCurrency": "USD",
"targetCurrency": "EUR"
}'