AI-powered DSA mentor — Chrome Extension (MV3)
Guides you through DSA problems with progressive hints, approach comparisons, and real-time coaching — without spoiling the solution.
- Clone or download this repo
- Open Chrome →
chrome://extensions - Enable Developer mode (top right)
- Click Load unpacked → select this folder
- Open any supported problem page — the CodeMentor button appears bottom-right
| Platform | Problem Parse | SPA Navigation | Code Scraping |
|---|---|---|---|
| LeetCode | ✅ | ✅ MutationObserver | ✅ Monaco |
| Codeforces | ✅ | ✅ History API | ✅ Textarea |
| HackerRank | ✅ | ✅ History API | ✅ CodeMirror |
| CodeChef | ✅ | ✅ MutationObserver | ✅ CodeMirror |
- Get a free Google Gemini API key
- Open the sidebar → Settings tab → paste your key → Save
- The key is stored in
chrome.storage.local— never sent to CodeMentor servers
Four progressive levels — no full solution ever revealed:
- Intuition — a tiny nudge in the right direction
- Approach outline — the general strategy
- Key observation — the insight that unlocks the solution
- Pseudo-code — structure without implementation
Lock hints at any rung to prevent accidental reveals.
Auto-triggers after a configurable time (default: 15 min) with a AI-generated guiding question. Asks about constraints, edge cases, or patterns — never the answer.
Compares 2–3 approaches in a table: name · idea · time · space. Built automatically from your chat context.
Detects likely pitfalls from your messages (off-by-one, integer overflow, wrong invariant, etc.) and shows them as chips above the chat.
Paste ≤30 lines of code in the chat box — CodeMentor explains each line without rewriting or solving for you.
Exports a markdown summary: problem, approaches explored, key insights, pitfalls, next steps. One click to copy.
Session timer with start/pause/reset. Live stats: time, hints, messages, approaches.
- API key management (local only)
- Stuck detector threshold (5–60 min)
- Mistake radar on/off
- Hidden diagnostics panel: platform, page type, parse status, last error
- Problem statements and your messages are sent to Google Gemini to generate responses
- Your API key, timer, hints, and chat history are stored only on your device in
chrome.storage.local - CodeMentor has no backend — zero data collection
├── background.js Service worker — Gemini API, feature handlers
├── content.js Injection, SPA router, problem scraping
├── sidebar.html Sidebar UI
├── sidebar.js Sidebar logic (all features)
├── styles/sidebar.css Scoped CSS (cm- prefix, no host leakage)
├── platforms/
│ ├── loader.js Registry initializer
│ ├── leetcode.js LeetCode scraper
│ ├── codeforces.js Codeforces scraper
│ ├── hackerrank.js HackerRank scraper
│ └── codechef.js CodeChef scraper
├── utils/storage.js Storage helpers
└── assets/ Icons
MIT © Harshit Singh & Vittoria Lanzo