Salary Wizard Jamaica is a salary planning app for people in Jamaica.
Its main purpose is to help users quickly understand what their pay means across different time periods and currencies, with an estimated self-employed tax view for Jamaica.
The app lets users:
- Enter pay in annual, monthly, weekly, daily, or hourly formats.
- Convert salary values across major currencies with live exchange rates.
- View salary breakdown rows and set per-row currency preferences.
- Estimate Jamaican self-employed tax from the calculated annual gross amount.
- Keep working with cached exchange rates when offline.
The client now reads exchange rates from a Cloudflare Worker endpoint instead of calling the upstream provider directly.
GET /api/exchange-ratesreturns the latest cached rates from Workers KV.- A daily cron trigger refreshes the KV snapshot from Open Exchange Rates.
- If KV is empty, the first request bootstraps it by fetching upstream once.
- Create a Workers KV namespace named for exchange rates.
- Set the KV namespace IDs in
wrangler.jsonc. - Add the
OPENEXCHANGE_APP_IDsecret with your Open Exchange Rates app id. - Optionally set
CORS_ORIGINif the Worker will be called from a different origin.
- Run
npm run worker:devto start the Worker locally onhttp://localhost:8787. - Run
npm run devfor the Vite client. - If you serve the Worker from another URL, set
VITE_EXCHANGE_RATE_API_URLin your Vite environment.
- Fill in the KV namespace IDs in
wrangler.jsonc. - Set
OPENEXCHANGE_APP_IDwithnpx wrangler secret put OPENEXCHANGE_APP_ID. - Deploy with
npm run worker:deploy.
In production, the client defaults to /api/exchange-rates. If your Worker is deployed on a separate hostname, set VITE_EXCHANGE_RATE_API_URL to that full Worker URL.
