React currency converter - a single page app made with React in functional programming like approach, which uses the exchanged rates API
Simple currency conversion app, which uses exchanged rates API from exchangeratesapi.io. The app is made with React in a Functional Programming like approach. Unit tests are made with Jest and Enzyme.
For the demo website purpose I used mocked data in this repo as since the 1st April 2021, the exchangeratesapi.io requires an API access key to use the service. You can sign up for a free API key or get the paid one on their website (just keep in mind that the free plan uses the http
protocol).
When you will have the API access key:
.env
file (remember to include the .env
in .gitignore
) or alternatively set the environment variable on deployment platformAPI_ACCESS_KEY
variable in the src/App.js
filesrc/components/DataContorller.js
:mockData
variable,componentDidMount
method:this.setState({ data: mockData });
this.loadData()
line
Used packages:
This project was bootstrapped with Create React App.
npm i
or yarn
to install packages (just a first time),npm start
or yarn start
(it runs the app in the development mode and opens http://localhost:3000 automatically to view in the browser).In the project directory run npm test
. It launches the test runner in the interactive watch mode.
Run npm coverage
to see coverage report.
To run a production build use command npm run build
or yarn build
. It builds the app for production to the build folder.
This project is licensed under the [MIT] License - see the LICENSE.md file for details.