Skip to content

mars-rift/openrates

Repository files navigation

OpenRates

OpenRates is a Windows Forms application that displays foreign exchange (forex) rates against the US Dollar, pulling data from the Open Exchange Rates API.

Features

OpenRates screenshot

  • Real-time Exchange Rates: Fetches the latest forex rates from the Open Exchange Rates API.
  • Choose Base Currency: Client-side re-basing lets you view rates against any display base without extra API calls.
  • Conversion Calculator: Quick convert between any two currencies by selecting source, target and entering an amount.
  • Export to CSV: Export the currently visible rates to a CSV for reporting or analysis.
  • Favorites: Mark currencies as favorites; favorites are persisted at %APPDATA%/OpenRates/favorites.json (ignored by git).
  • Auto-refresh: Configurable auto-refresh interval with the option to enable/disable automatic refresh.
  • Historical Rates: Request historical rates for a selected date (requires API plan that permits historical queries).
  • Responsive UI & Accessibility: Improved layout, scrollable dropdowns, anchors and thread-safe UI updates for a smoother experience.
  • Security-first: The app reads the OPENEXCHANGERATES_API_KEY environment variable at runtime; the repo includes a pre-commit detect-secrets hook and a baseline to prevent accidental secret commits.

Prerequisites

Before you begin, ensure you have the following:

  • Windows Operating System
  • .NET Framework (please specify version, e.g., 4.8)
  • Visual Studio
  • An API Key from Open Exchange Rates

Getting Started

To get a local copy up and running, follow these simple steps.

Installation

  1. Clone the repository:

    git clone https://github.com/mars-rift/openrates.git
  2. Open the solution file (.sln) in Visual Studio.

  3. Configure your API Key (recommended: environment variable)

    The application reads the OPENEXCHANGERATES_API_KEY environment variable at runtime. Do not store real API keys in files that are committed to version control.

    • Windows PowerShell (sets for current user):

      [System.Environment]::SetEnvironmentVariable("OPENEXCHANGERATES_API_KEY","<your_api_key>","User")
    • Windows CMD:

      setx OPENEXCHANGERATES_API_KEY "<your_api_key>"
    • macOS / Linux (bash):

      export OPENEXCHANGERATES_API_KEY="<your_api_key>"
    • Alternatively, for local development you can use the .NET user-secrets store (project must opt into it):

      dotnet user-secrets init
      dotnet user-secrets set "OPENEXCHANGERATES_API_KEY" "<your_api_key>"

    If you must use a config file for local testing, put your key in an untracked file such as appsettings.Development.json, add that filename to .gitignore, and never commit the file containing secrets.

Additional local features

  • Favorites are stored locally in %APPDATA%/OpenRates/favorites.json (or favorites.json if you run in a portable setup). This file is ignored by .gitignore to avoid accidental commits.
  • The app now supports:
    • Choosing a display base currency (client-side re-basing) without extra API calls
    • A simple conversion calculator (select source/target and amount)
    • Exporting current rates to CSV
    • Auto-refresh with configurable interval
    • Fetch historical rates for a selected date (requires API plan that allows historical endpoint)

See the app UI for controls and behavior.

  1. Build the solution (F6 or Build > Build Solution).

  2. Run the application (F5 or Debug > Start Debugging).

Usage

  1. Launch the application.
  2. The main window will display the latest exchange rates with USD as the base currency.
  3. You can refresh the rates as needed.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Pre-commit hooks (recommended)

To prevent secrets from being committed in the future, this repository uses pre-commit with the detect-secrets hook. Please install and enable the hooks locally:

  1. Install pre-commit (if you don't have it):

    pip install pre-commit
  2. Install the hooks for this repo:

    pre-commit install
  3. Run the checks on all files (optional but recommended):

    pre-commit run --all-files

If detect-secrets flags anything that looks like a secret, follow the guidance in SECURITY.md to rotate and remove any exposed secret from history.

License

Distributed under the MIT License. See LICENSE for more information.


About

Currency Prices and Converter

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages