OpenRates is a Windows Forms application that displays foreign exchange (forex) rates against the US Dollar, pulling data from the Open Exchange Rates API.
- 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_KEYenvironment variable at runtime; the repo includes apre-commitdetect-secretshook and a baseline to prevent accidental secret commits.
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
To get a local copy up and running, follow these simple steps.
-
Clone the repository:
git clone https://github.com/mars-rift/openrates.git
-
Open the solution file (
.sln) in Visual Studio. -
Configure your API Key (recommended: environment variable)
The application reads the
OPENEXCHANGERATES_API_KEYenvironment 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(orfavorites.jsonif you run in a portable setup). This file is ignored by.gitignoreto 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.
-
Build the solution (F6 or
Build > Build Solution). -
Run the application (F5 or
Debug > Start Debugging).
- Launch the application.
- The main window will display the latest exchange rates with USD as the base currency.
- You can refresh the rates as needed.
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".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
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:
-
Install
pre-commit(if you don't have it):pip install pre-commit
-
Install the hooks for this repo:
pre-commit install
-
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.
Distributed under the MIT License. See LICENSE for more information.
