- Overview
- Key Features
- Screenshots
- Tech Stack
- Architecture
- Installation & Setup / Build
- Folder Structure
- NPM Scripts
- Environment Variables
- Common Issues / FAQ
- Contributing
- License
TUFDsa is a feature-rich Chrome Extension designed for developers and students who want to systematically improve their Data Structures and Algorithms (DSA) skills.
- π― Decision Fatigue: No more wondering "which problem should I solve today?"
- π Scattered Progress: Track all your solved problems across multiple platforms in one place
- π₯ Motivation Loss: Streak system keeps you accountable with daily practice goals
- π§ Context Switching: Get AI-powered hints without leaving your coding environment
- πΌ Job Seekers preparing for technical interviews
- π Students learning DSA fundamentals
- π¨βπ» Developers wanting to stay sharp with daily practice
- π Competitive Programmers tracking their progress
| Feature | Description |
|---|---|
| π² Random Problem Generator | Get a random problem based on difficulty, topics, or company tags |
| π A2Z DSA Sheet Integration | Follow the popular TakeUForward A2Z DSA course systematically |
| π₯ Streak System | Calendar-based streak tracking with "at-risk" warnings |
| π Multi-Platform Search | Search problems from LeetCode, GeeksforGeeks, and Code360 |
| π€ AI Assistant | Ask AI for hints, complexity analysis, and explanations |
| π New Tab Override | Replace Chrome's new tab with your DSA dashboard |
| β‘ Quick Access | Open problems with id for quick access across 3000+ problem from LeetCode, GeeksforGeeks, and Code360 |
| ποΈ Advanced Filters | Filter by difficulty, topics, company, and solved status |
| π Torture Mode | Hardcore mode that disables skipping problems |
| π Statistics Dashboard | Track total solved, daily progress, and streak history |
| Technology | Version | Purpose |
|---|---|---|
| React | 18.2.x | UI Components & State Management |
| Vite | 7.x | Build Tool & Dev Server |
| @crxjs/vite-plugin | 2.0.0-beta | Chrome Extension Integration |
| Tailwind CSS | 4.x | Utility-First Styling |
| Package | Purpose |
|---|---|
react-markdown |
Render AI responses with Markdown formatting |
axios |
HTTP client (used in scrapers) |
puppeteer |
Web scraping for problem data updates |
| Tool | Purpose |
|---|---|
prettier |
Code formatting |
gulp + gulp-zip |
Extension packaging |
glob |
File pattern matching |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CHROME BROWSER β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β TUFdsa EXTENSION β β
β β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ ββββββββββββββ β β
β β β POPUP β β NEWTAB β β OPTIONS β β SIDEPANEL β β β
β β β popup/ β β newtab/ β β options/ β β sidepanel/ β β β
β β β β β β β β β β β β
β β β βββββββββ β β βββββββββ β β βββββββββ β β βββββββββ β β β
β β β β React β β β β React β β β β React β β β β React β β β β
β β β β App β β β β App β β β β App β β β β App β β β β
β β β βββββ¬ββββ β β βββββ¬ββββ β β βββββ¬ββββ β β βββββ¬ββββ β β β
β β ββββββββΌβββββββ ββββββββΌβββββββ ββββββββΌβββββββ βββββββΌβββββββ β β
β β β β β β β β
β β ββββββββββββββββββ΄βββββββΌββββββββββ΄ββββββββββββββββ β β
β β β β β
β β βΌ β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β CHROME STORAGE API β β β
β β β β β β
β β β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β β β
β β β β sync storage β β local storage β β β β
β β β β β β β β β β
β β β β β’ solveHistory β β β’ (currently unused) β β β β
β β β β β’ userSettings β β β β β β
β β β β β’ currentProblem β β β β β β
β β β β β’ savedFilters β β β β β β
β β β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β β
β β β chrome.storage.onChanged β β
β β βΌ β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β SERVICE WORKER (background/) β β β
β β β β β β
β β β β’ chrome.runtime.onMessage listener β β β
β β β β’ Event-driven lifecycle β β β
β β β β’ Minimal code (offloads to UI contexts) β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β WEB PAGE CONTEXT β β
β β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β CONTENT SCRIPTS β β β
β β β β β β
β β β contentScript/index.js contentScript/askAiHelper.js β β β
β β β β’ Runs on all HTTP(S) β’ Runs on LeetCode/GFG/Code360 β β β
β β β β’ Generic injection β’ Extracts user code β β β
β β β (With custom userscript) β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA ENTITIES β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SOLVE HISTORY (Source of Truth) β β
β β β β
β β { β β
β β "randomSolveHistory": { β β
β β "[problemId]": 1704067200000 // timestamp β β
β β }, β β
β β "a2zSolveHistory": { β β
β β "[problemId]": 1704153600000 β β
β β } β β
β β } β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β USER SETTINGS β β
β β β β
β β { β β
β β darkMode: true, β β
β β tortureMode: false, β β
β β hyperTortureMode: false, β β
β β dailyGoal: 1, β β
β β showDifficulty: true, β β
β β showTopics: true, β β
β β ... β β
β β } β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β CURRENT PROBLEM STATE β β
β β β β
β β { β β
β β "currentRandomProblem": { ...problemObject }, β β
β β "lastA2zIndex": 42, β β
β β "randomProblemDataSource": "leetcode" | "gfg" | ... β β
β β } β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | File | Purpose |
|---|---|---|
| Popup | src/popup/popup.html |
Quick access toolbar popup |
| New Tab | src/newtab/newtab.html |
Dashboard replacing Chrome's new tab |
| Options | src/options/options.html |
Settings and data management |
| Side Panel | src/sidepanel/sidepanel.html |
Chrome side panel integration |
| DevTools | src/devtools/devtools.html |
Developer tools panel |
| Service Worker | src/background/index.js |
Dummy not used now |
| Content Scripts | src/contentScript/ |
DOM interaction on coding platforms |
User clicks "Ask AI" with code
β
βΌ
βββββββββββββββββββ chrome.tabs.sendMessage βββββββββββββββββββ
β Popup/UI β ββββββββββββββββββββββββββββββΆ β Content Script β
β β β β
β β ββββββββββββββββββββββββββββββ β Extracts code β
βββββββββββββββββββ { type: "USER_CODE", ... } βββββββββββββββββββ
β
βΌ
Sends to Cohere API
β
βΌ
Displays AI Response
- Node.js >= 20.19.0
- npm or yarn
- Google Chrome (latest recommended)
git clone https://github.com/JitishxD/TUFDsa.git
cd TUFDsanpm install
# or
yarn installStart the development server with hot reload:
npm run dev
# or
yarn dev- Vite starts dev server
- CRXJS plugin watches for changes
- Extension auto-reloads in Chrome
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right)
- Click Load unpacked
- Select the
build/folder from this project
Note: During development, the extension will auto-reload when you make changes. You may need to refresh the extension or reload pages for content script changes.
npm run build
# or
yarn build- Vite builds optimized bundles
- CRXJS generates final
manifest.json - Assets are hashed for caching
- Output goes to an optimized production build in the
build/directory.
npm run zip- Runs production build
- Gulp zips the
build/folder - Creates
TUFDsa-{version}.zipinpackage/
TUFDsa/
βββ π package.json # Dependencies and scripts
βββ π vite.config.js # Vite + CRXJS configuration
βββ π vitest.config.js # Vitest config file
βββ π jsconfig.json # TypeScript/JS configuration
β
βββ π src/ # Source code
β βββ π manifest.js # Dynamic manifest generation
β βββ π zip.js # Gulp-based packaging script
β β
β βββ π background/ # Service worker
β β βββ π index.js # Message listeners, events
β β
β βββ π contentScript/ # Content scripts
β β βββ π index.js # Generic content script
β β βββ π askAiHelper.js # Code extraction for AI
β β
β βββ π popup/ # Popup UI
β β βββ π popup.html # HTML entry point (manifest: src/popup/popup.html)
β β βββ π index.jsx # Entry point
β β βββ π PopUpHome.jsx # Main popup component
β β βββ π aiIntegration.js # Cohere AI integration
β β βββ π Components/ # Popup components
β β βββ π Styles/ # Popup styles
β β
β βββ π newtab/ # New Tab UI
β β βββ π newtab.html # HTML entry point (manifest: src/newtab/newtab.html)
β β βββ π index.jsx # Entry point
β β βββ π NewTab.jsx # Dashboard component
β β βββ π Components/ # Dashboard components
β β βββ π Styles/ # Dashboard styles
β β
β βββ π options/ # Options Page
β β βββ π options.html # HTML entry point (manifest: src/options/options.html)
β β βββ π index.jsx # Entry point
β β βββ π Options.jsx # Settings component
β β βββ π Components/ # Options components
β β βββ π Styles/ # Options styles
β β
β βββ π sidepanel/ # Chrome Side Panel
β β βββ π sidepanel.html # HTML entry point (manifest: src/sidepanel/sidepanel.html)
β β βββ π SidePanel.jsx # Side panel component
β β
β βββ π devtools/ # Chrome DevTools Panel
β β βββ π devtools.html # HTML entry point (manifest: src/devtools/devtools.html)
β β βββ π DevTools.jsx # DevTools component
β β
β βββ π problem-data/ # Problem datasets (JSON)
β β βββ π DSAa2zProblems.json
β β βββ π leetCodeAllProblemDump.json
β β βββ π gfg_problems.json
β β βββ π code360_problems_indexed.json
β β
β βββ π utils/ # Shared utilities
β β βββ π statsTracker.js # Streak & stats logic
β β βββ π problemFilters.js # Filter utilities
β β βββ π useRandomProblem.js # Shared hook
β β βββ π uiHelpers.js # UI utilities
β β
β βββ π assets/ # Static assets
β
βββ π public/ # Public assets
β βββ π icons/ # Extension icons
β βββ π img/ # Images (logo, etc.)
β
βββ π Scrapper/ # Problem data scrapers
βββ π leetCodeScrape/ # LeetCode scraping
βββ π geeksforgeeks/ # GFG scraping
βββ π code360/ # Code360 scraping
βββ π TUFScrape/ # TakeUForward scraping
| Script | Command | Description |
|---|---|---|
| dev | npm run dev |
Start Vite dev server with HMR |
| build | npm run build |
Production build to build/ |
| preview | npm run preview |
Preview production build |
| fmt | npm run fmt |
Format code with Prettier |
| zip | npm run zip |
Build + create distributable ZIP |
The extension currently doesn't require environment variables for basic functionality.
| Variable | Purpose | Where Used |
|---|---|---|
| API Keys | Stored in Chrome Storage | Options page / AI feature |
Note: For security, API keys (like Cohere API key for AI features) are stored in Chrome's sync storage rather than environment variables.
Problem: "Load unpacked" shows errors
Solution:
- Ensure you ran
npm run buildfirst - Select the
build/folder, not the project root - Check for manifest syntax errors
Problem: Changes don't reflect in the extension
Solution:
- For popup/newtab: Close and reopen the popup/tab
- For content scripts: Refresh the target page
- For background: Reload the extension from
chrome://extensions/
Problem: "Could not reach content script" error
Solution:
- Refresh the target page after loading the extension
- Check if the URL matches patterns in
manifest.js - Verify permissions in manifest
Problem: "Permission denied" or API errors
Solution:
- Grant the
https://api.cohere.ai/*permission when prompted - Verify your API key is correct
- Check network connectivity
Problem: Solve history not saving
Solution:
- Clear old data from Options page
- Use the "Data Management" tab to export/backup
- Consider resetting progress if history is too large
Problem: API requests blocked
Solution:
- Ensure origin permissions are in manifest
- Use background script for cross-origin requests
We welcome contributions! Here's how to get started:
| Branch | Purpose |
|---|---|
main |
Production-ready code |
develop |
Integration branch |
feature/* |
New features |
fix/* |
Bug fixes |
docs/* |
Documentation updates |
The tests are in src/utils/streakCalculator.test.js and imports the implementation from statsTracker.js.
npm run testFollow Conventional Commits:
feat: add new filter option for company tags
fix: resolve streak calculation bug
docs: update README with new screenshots
refactor: simplify useRandomProblem hook
- Formatting: Run
npm run fmtbefore committing - Components: Use functional components with hooks
- Naming:
- Components:
PascalCase - Utilities:
camelCase - CSS classes: Use Tailwind utilities
- Components:
- Fork the repository
- Create a feature branch
- Make your changes
- Run
npm run fmt - Submit a PR with a clear description
This project is licensed under the MIT License - see the LICENSE file for details.
- TakeUForward for the A2Z DSA sheet
- LeetCode, GeeksforGeeks, Code360 for problem data
- CRXJS for the amazing Vite plugin
- Cohere for AI API
Made with β€οΈ for the DSA community