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 π§ .
- Host: GitHub
- URL: https://github.com/glory42/currency_nostalgia_api
- Owner: Glory42
- License: mit
- Created: 2025-04-01T20:36:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-05T18:53:27.000Z (about 1 year ago)
- Last Synced: 2025-06-19T17:51:47.410Z (about 1 year ago)
- Topics: axios, cron-jobs, currency-exchange-rates, express, historical-data, json, nodejs, price-comparison, rest-api, supabase, time-travel
- Language: JavaScript
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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