Skip to content

This is a simple currency converter web application built using React, Axios, and the ExchangeRate API. The app allows users to convert an amount from one currency to another in real-time using up-to-date exchange rates.

Notifications You must be signed in to change notification settings

surajgharpankar28/Currency-Converter

Repository files navigation

Currency Converter

This is a simple currency converter web application built using React, Axios, and the ExchangeRate API. The app allows users to convert an amount from one currency to another in real-time using up-to-date exchange rates.

Demo

Check out the live demo here

Features

  • Convert currency from one unit to another (USD, EUR, INR, GBP, AUD).
  • Real-time exchange rates using the ExchangeRate API.
  • Error handling for API failures and invalid inputs.
  • Formatted currency display for better readability.

Technologies Used

  • React: Front-end library for building the user interface.
  • Axios: Library for making HTTP requests to fetch exchange rates from the API.
  • ExchangeRate API: Provides real-time exchange rates for currency conversion.

Installation

  1. Clone the repository:
    git clone [https://github.com/your-username/currency-converter.git](https://github.com/surajgharpankar28/Currency-Converter.git)
    cd currency-converter
    
  2. Install dependencies:
    npm install
    
  3. Set up the ExchangeRate API:
    • To obtain an API key, sign up on ExchangeRate API.
    • Create a .env file in the project root and add your API key:
      VITE_API_KEY=your_api_key_here
  4. Add the following to your 'vite.config.js' file.
 import { defineConfig } from "vite";
 import react from "@vitejs/plugin-react";
 
 // https://vite.dev/config/
 export default defineConfig({
   plugins: [
     react(),
     {
       name: "replace-process-env",
       // Use the "transform" hook to replace process.env variables
       transform(code) {
         return code.replace(
           /process\.env\.VITE_API_KEY/g,
           JSON.stringify(process.env.VITE_API_KEY)
         );
       },
     },
   ],
 });
  1. Run the application
    npm start

About

This is a simple currency converter web application built using React, Axios, and the ExchangeRate API. The app allows users to convert an amount from one currency to another in real-time using up-to-date exchange rates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published