An open API service indexing awesome lists of open source software.

https://github.com/glory42/currency_nostalgia_api

πŸ’± A Node.js REST API for comparing real-time and historical USD exchange rates. Combines live data from CurrencyFreaks with structured JSON datasets πŸ—‚οΈ to analyze product price changes over time πŸ“Š. Ideal for currency-based cost analysis, nostalgia pricing tools, and educational use cases 🧠.
https://github.com/glory42/currency_nostalgia_api

axios cron-jobs currency-exchange-rates express historical-data json nodejs price-comparison rest-api supabase time-travel

Last synced: 5 months ago
JSON representation

πŸ’± A Node.js REST API for comparing real-time and historical USD exchange rates. Combines live data from CurrencyFreaks with structured JSON datasets πŸ—‚οΈ to analyze product price changes over time πŸ“Š. Ideal for currency-based cost analysis, nostalgia pricing tools, and educational use cases 🧠.

Awesome Lists containing this project

README

          

# πŸ’± Currency Nostalgia API

Currency Nostalgia is a currency comparison API that allows users to compare historical USD exchange rates with today's product prices. It uses [CurrencyFreaks](https://currencyfreaks.com/) free API for current exchange rates and manually added JSON data for historical values and product prices.

## πŸš€ Features

- Fetches live exchange rates using CurrencyFreaks API.
- Compares historical product prices with today's equivalents.
- Stores historical exchange rates and product data in local JSON files.
- Schedules daily currency rate updates using `node-cron`.

## πŸ”— Live Demo (Hosted on Render)

You can test the API live on Render:

- **Get the latest exchange rates:**
https://webappkindathingidk.onrender.com/currency/latest

- **Compare historical vs current product price:**
[`https://webappkindathingidk.onrender.com/nostalgia/compare?year=2015&productId=1`](https://webappkindathingidk.onrender.com/nostalgia/compare?year=2015&productId=1)
↳ You can modify `year` and `productId` to test other combinations.

## πŸ› οΈ Project Structure
````
project-root/
β”œβ”€β”€ node_modules/ # Node.js modules
β”œβ”€β”€ public/ # Static files (CSS, JavaScript, images)
β”‚ β”œβ”€β”€ css/
β”‚ β”œβ”€β”€ js/
β”‚ └── img/
β”œβ”€β”€ views/ # Frontend files (HTML, template engine files)
β”‚ └── layouts/
β”œβ”€β”€ routes/ # Route definitions
β”‚ β”œβ”€β”€ currency.js
β”‚ └── nostalgia.js
β”œβ”€β”€ controllers/ # Route handlers
β”‚ β”œβ”€β”€ currencyController.js
β”‚ └── nostalgiaController.js
β”œβ”€β”€ config/ # API and DB configuration
β”‚ β”œβ”€β”€ api.js
β”‚ └── supabase.js
β”œβ”€β”€ services/
β”‚ └── exchangeRateSerices.js
β”œβ”€β”€ data/ # Data Files
β”‚ β”œβ”€β”€ products.json
β”‚ └── historicalExchange.json
β”œβ”€β”€ utils/ # Utility functions
β”‚ └── apiUtils.js
β”œβ”€β”€ .env # Environment variables
β”œβ”€β”€ .gitignore # Files to be ignored by Git
β”œβ”€β”€ package.json # Node.js project configuration
β”œβ”€β”€ server.js # Main server file
└── README.md # Project description
````

## βš™οΈ Setup Instructions

Projenin çalışabilmesi için aşağıdaki adımları takip edin:

### 1. Clone the repository:
```bash
git clone https://github.com/Glory42/webAppKindaThingidk.git
cd webAppKindaThingidk
```

### 2. Install dependencies:
````bash
npm install
`````

### 3. Create a .env file:
In the project root, create a .env file with the following content:
````
CURRENCY_API_KEY=your_currencyfreaks_api_key
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_supabase_anon_key`
````
### 4. Start the server:
````bash
npm start
````
The API will be accessible at:
```` bash
http://localhost:3000
````

## πŸ“¦ Dependencies
| Package | Purpose |
| ----------------------- | ----------------------------- |
| `express` | Web framework |
| `axios` | HTTP client |
| `cors` | Cross-Origin Resource Sharing |
| `node-cron` | Scheduled background tasks |
| `@supabase/supabase-js` | Supabase client for DB access |

## πŸ“ Data Files
* data/products.json: Historical product prices per year.

* data/historicalExchange.json: Manually stored historical exchange rates.

## πŸ“¬ Contributing
Pull requests and contributions are welcome. Please open an issue first to discuss your ideas before making major changes.

MIT [LICENSE](LICENSE) Β© 2025 GΓΆrkem Karyol