This project is a simple currency conversion application built using React, Vite, Vitest and TailwindCSS. It allows users to convert amounts between EUR, USD, and JPY using real-time exchange rates.
Before you begin, ensure you have the following installed:
Node.js
(preferably the latest LTS version)npm
orYarn
Clone the repository and install its dependencies:
git clone https://github.com/nikolailehbrink/currency-converter
cd currency-converter
npm install
Create a .env
file in the root of your project and populate it with the necessary environment variables:
VITE_EXCHANGE_API_KEY=your_exchange_rate_api_key_here
Replace your_exchange_rate_api_key_here
with your actual API key that you can obtain for free from
https://www.exchangerate-api.com/.
To start the development server, run the following command:
npm run dev
This command will start a local development server and open the application in your default web browser. The application will automatically reload if you make changes to any of the source files.
To build the application for production, use:
npm run build
This command will produce a dist/
directory with all the assets compiled and optimized for production use.
To execute the tests, run:
npm run test
This will run the test suite configured with Vitest.
npm run preview
: Locally preview production buildnpm run lint
: Lint and fix files (if you have ESLint configured)
Specify the license under which your project is made available (e.g., MIT).