How chukssomzzy/adfriend works
Project type and purpose
• This is a Chrome extension built with React, TypeScript, and Vite.
• It injects “quote” and “reminder” replacements into web pages and provides a popup UI (and possibly an options page) to manage reminders.
File structure
• Top-level:
• manifest.json (in public/) defines extension configuration
• build artifacts (adfriend.zip, build.crx) are packaged outputs
• index.html + Vite config handle bundling of the React app
• src/
• App.tsx, pages/ (DailyReminder.tsx, QuotePage.tsx) → Popup or Options UI
• components/ (reminderForm.tsx) → reusable UI bits
• scripts/
– content.js → content script that runs in the page context
– service-worker.js → background/service worker for event handling
– replacements/ & utils/ → logic for injecting quotes/reminders and managing state
• utils/ at root → shared helper functions
Extract insights from README
• Build steps: npm install → npm build
• After build, load the “build/” folder as an unpacked Chrome extension
• No backend server—entirely client-side and extension‐side logic
Detail
• Modules (e.g., quoteReplacement.js, reminderForm.tsx) as sub-components if granularity is needed.
• Don’t overlook the build pipeline (Vite) as it unifies TS → JS and bundles assets for Chrome.