How tftc-holdings-inc/opportunity-cost works
Project type and purpose
• This is a hybrid full-stack project consisting of:
• A browser extension (Chrome & Firefox) that scans any webpage for fiat prices, fetches current Bitcoin rates, and replaces or augments those prices in situ.
• A marketing/demo website (Next.js) with a serverless API endpoint (/api/bitcoin-price) that also returns live Bitcoin rates.
• The README confirms the goals: “See the True Cost of Everything in Bitcoin,” privacy-first local processing, and a customizable popup/options UI.
File structure
Top-level directories:
• /extension – source + packaging for multiple targets
– chrome/ (manifest.json only – final package)
– firefox-extension-submission/ (React/TSX code, Vite configs, manifest for Firefox submission)
– firefox/ (manifest.json only – final package)
– shared/ (common React/TSX code and Vite build configs used by both targets)
• /web – Next.js application
– src/app/api/bitcoin-price/route.ts – serverless function
– src/app/... – demo pages, install page, privacy policy, etc.
– components/ – landing-page & UI components
– public/ – static assets, packaged extension ZIPs
Configuration/build files: Vite configs, Next.js configs, ESLint, tsconfig, package.json, pnpm/yarn lockfiles.
README for insights
• Confirms extension fetches rates from an API (could be the /api/bitcoin-price endpoint or a third-party service).
• Describes runtime flow: scan DOM via content script + MutationObserver, calculate local conversions, no user data sent out.
• Describes the popup/options UI for settings, and the live dual-display vs BTC-only modes.