I'll declutter the app down to just the random word generator, keeping only the meaning and root word. Let me first look at the current structure to understand what I'm working with.
Now let me look at the dictionary API library and word bank to understand what I need to keep and how to add root extraction.
Now I understand the structure. Let me look at the roots data to build a root-detection system, and check the current word bank for exam relevance.
I have a good understanding. My plan:
- Create a root-detection module — a comprehensive map of Latin/Greek roots and prefixes that can analyze any word and identify its root + meaning.
- Build a new minimal App — just a random word generator that fetches an exam-relevant word, shows only the meaning and root word, with a button to get the next random word.
- Remove all other components and views.
Let me first create the root-detection module with a rich root dictionary.
The greg2 empty entry is filtered out but let me remove it to keep it clean.
Now let me build an exam-relevant word bank. The current wordbank is good but let me check it and create a dedicated exam-relevant curated list. Let me look at the existing wordbank.
The word bank is already exam-relevant (GRE/SSC/CAT high-frequency words). This is exactly what we need. Now let me update the dictionary API mapper to keep it lean, and add root analysis. First, let me update the mapApiEntryToWord to populate the root field using my analyzer.
Now let me add a fetchRandomWord function to the dictionary API that picks a random exam-relevant word and fetches it (retrying if the API doesn't have it).
Now let me completely rewrite the App to be a minimal, beautiful random word generator showing only the word, meaning, and root. Let me update index.html title first, then the App.
Now let me write the new minimal App.tsx.
Now let me delete all the components and library files that are no longer needed to declutter the codebase.
Now let me delete the other unused lib files (predictor, revision, dailySession, storage) and the big curated data file. But first I need to check dependencies — dictionaryApi.ts imports from ../data/wordbank, and my new App only imports dictionaryApi, types, hooks, and roots. Let me check what hooks.ts imports.
hooks.ts uses loadTheme, saveTheme, loadSettings, saveSettings from storage. I only need the theme functions now. Let me slim down hooks.ts to only what's used, and create a minimal storage.ts for just theme. Actually, let me simplify — I'll replace hooks.ts to only contain useTheme with self-contained localStorage logic, then delete storage.ts and all the other lib files.
Let me first check what dictionaryApi.ts imports besides wordbank.
So dictionaryApi.ts imports from types, roots, and data/wordbank. Now let me rewrite hooks.ts to be minimal (just useTheme, self-contained), then delete storage, predictor, revision, dailySession, and the big data/index.ts.
Now delete the unused lib and data files.
Now types.ts still has lots of unused types, but that's fine as long as Word, Difficulty, CEFR, Category remain (used by dictionaryApi). Let me trim types.ts to just what's needed to keep things clean.
Now let me build to see if everything compiles cleanly.
Build succeeds and the bundle dropped from 520 KB to 241 KB. Let me verify the final file structure is clean.
Clean structure. Now let me verify the word bank still has plenty of exam-relevant words and check that the UNIQUE_WORD_BANK export is intact since it's central to the random generator.
Everything is intact. The cn utility is still used? Let me check — my new App.tsx doesn't import cn. Let me verify it's not causing an unused-file issue (it won't, since unused files are just not bundled). The build already passed cleanly, so we're good.
Let me do a final review of the App to make sure the experience is polished. Let me verify the CSS classes I used (aurora, dot-grid, kbd, animate-scale-in, btn-press, font-display) all exist.
All CSS classes exist. The app is complete and decluttered. Here's a summary of what I did:
Decluttered to a Single Random Word Generator
Removed everything else
Deleted 13 components (Sidebar, SessionPlayer, QuizView, StatsView, BookmarksView, SearchView, PredictorView, DailyView, DailySessionView, SettingsView, RevisionView, LibraryViews, WordCard) and 5 lib/data files (storage, predictor, revision, dailySession, and the big curated data/index.ts). Bundle shrank from 520 KB → 241 KB.
The new app — clean and focused
A single, beautiful centered card that shows only the word, its meaning, and its root word — nothing else. Featuring:
- A gradient "New Random Word" button (plus Space/Enter keyboard shortcut)
- Ambient aurora + dot-grid background, dark/light toggle
- Smooth loading skeleton and offline-friendly error card
Random generator pulls exam-relevant words
- New
fetchRandomWord() picks from the curated ~1,000-word exam bank (GRE/SSC/CAT/UPSC/Banking high-frequency vocabulary — the same newspaper & professional word list), fetches its live definition from dictionaryapi.dev, retries if the API lacks a word, and avoids repeating recent words.
- Results are cached in localStorage, so words work offline after first view.
Root word support added
- New
src/lib/roots.ts — an offline analyzer with ~130 Latin/Greek roots plus common prefixes. For any fetched word it identifies the most specific root (longest-match first, prefix fallback) and shows the root + its meaning + origin, e.g. "loqu — to speak (Latin 'loqui')".
The app now does exactly one thing well: tap for a random exam-relevant word and see its meaning and root.
Files built: src/lib/roots.ts, src/lib/dictionaryApi.ts, index.html, src/App.tsx, src/hooks.ts, src/lib/types.ts