joaoblyss / exchange-rate-wicket-app

Exchange Rate Calculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

ECB Exchange Rates Calculator

A simple EURO currency exchange calculator.

The user's input, in EUROS, will be converted to foreign currencies based on cross-currency rates provided by the European Central Bank.

The exchange rates are fetched daily from the European Central Bank (ECB) Reference Rates.

Table of Contents

Pre-Requisites

  • Java OpenJDK 8
  • A MongoDB instance fully accessible

Running this Project

Clone this Repository

In you system terminal, navigate to a source-code folder of your choice and clone the repository with the command

$ git clone https://github.com/joaoblyss/coding-challenge.git
$ cd coding-challenge

Setup Up The Database Access

After checking out the project, you'll need to set the following properties in the application.properties file:

Property Key Description
spring.data.mongodb.host Set here the MongoDB server address (host only)
spring.data.mongodb.database Set here the name of the database you've created in the MongoDB server

Starting the Application

In the system terminal, execute the following:

$ ./mvnw spring-boot:run

⚠️ On Windows, you might need to use mvnw.cmd instead

This is how a successful startup should look like:

spring-run

Basic Usage

On the web browser, access http://localhost:8080.

The GUI consists two basic input fields and one output, such as this:

calculator

In the input field, type the value, in EURO, to be converted into a foreign currency, then select in the dropdown below the target currency.

The result must be shown as below:

calc-result

🚧 The text input still accepts alphabetic characters, but no calculation is performed unless the data input is a valid number.

Troubleshooting

Fixing the Maven Wrapper Executable

Make sure the mvnw file has the propper execution permissions.

Under Linux (and Cygwin)

$ chmod 744 mvnw

Under Windows

> icacls /grant:r Everyone:F mvnw.cmd

Update CA Certificates

During the execution of the mvnw packaging tool under Ubuntu, there might be a failure concerning the trustAnchors parameter, with the error message trustAnchors parameter must be non-empty. To work around this, it might be necessary to purge certificates by doing as follows:

  • remove the /etc/ssl/certs/java/cacerts
  • run update-ca-certificates -f
  • retry mvnw spring-boot:run

About

Exchange Rate Calculator


Languages

Language:Java 87.3%Language:HTML 8.2%Language:CSS 4.4%Language:JavaScript 0.1%