This guide will help you set up the SpurHacked language learning Chrome extension with its Python backend.
- Python 3.7+ installed on your system
- pip (Python package manager)
- Google Chrome browser
- Git (optional, for cloning the repository)
-
Clone or download the project:
git clone <repository-url> cd spurHacked
-
Run the setup script:
./setup.sh
This script will:
- Check for Python and pip installation
- Install backend dependencies
- Start the backend server
-
Navigate to the backend directory:
cd backend -
Install Python dependencies:
pip install -r requirements.txt
-
Start the backend server:
python app.py
The server will start on
http://localhost:5000
-
Open Chrome and navigate to
chrome://extensions/ -
Enable Developer Mode:
- Toggle the "Developer mode" switch in the top right corner
-
Load the extension:
- Click "Load unpacked"
- Select the
extensionfolder from the project directory
-
Verify installation:
- The SpurHacked extension should appear in your extensions list
- You should see the extension icon in your Chrome toolbar
The backend server runs on http://localhost:5000 by default. You can modify the port in backend/app.py if needed.
-
Click the extension icon in your Chrome toolbar
-
Configure your settings:
- Target Language: Choose French, Spanish, or German
- Learning Level: Select Beginner, Intermediate, or Advanced
- Enable Translation: Toggle the switch to start translating
-
Test the connection:
- Click "Test Connection" to verify the backend is running
- You should see "✅ Backend connection successful!"
- Enable translation in the extension popup
- Navigate to any webpage (news articles, blogs, etc.)
- Wait for the page to load - the extension will automatically process the text
- Hover over translated words to see meaning and pronunciation
- Real-time Translation: Words are translated based on your learning level
- Interactive Tooltips: Hover over translated words for detailed information
- Non-intrusive: Original page layout and styling are preserved
- Dynamic Content: Handles dynamically loaded content
- Statistics: Track how many words you've learned
- French (fr): Beginner, Intermediate, Advanced levels
- Spanish (es): Beginner, Intermediate, Advanced levels
- German (de): Beginner, Intermediate, Advanced levels
Problem: "Cannot connect to backend"
- Solution: Make sure the Python server is running on
http://localhost:5000 - Check: Run
curl http://localhost:5000/healthin terminal
Problem: "Module not found" errors
- Solution: Install dependencies with
pip install -r requirements.txt
Problem: Port already in use
- Solution: Change the port in
backend/app.pyor kill the process using the port
Problem: Extension not loading
- Solution:
- Check that Developer mode is enabled
- Reload the extension from
chrome://extensions/ - Check the console for errors
Problem: No translations appearing
- Solution:
- Verify the backend is running
- Check that translation is enabled in the popup
- Try refreshing the page
- Check browser console for errors
Problem: Tooltips not showing
- Solution:
- Make sure you're hovering over blue underlined words
- Check if any browser extensions are blocking tooltips
- Try disabling other extensions temporarily
- "CORS error": Backend server is not running or CORS is not configured
- "Network error": Check your internet connection and backend server status
- "Permission denied": Make sure the extension has necessary permissions
- Add language data to
backend/app.pyin theTRANSLATION_DATAdictionary - Update the popup to include the new language option
- Test the integration
- Backend: Add new endpoints in
backend/app.py - Extension: Update content script and popup as needed
- Testing: Test on various websites to ensure compatibility
- The backend runs on
localhostonly for development - In production, implement proper authentication and HTTPS
- The extension only accesses web pages you visit
- No data is stored or transmitted to external servers (except your backend)
If you encounter issues:
- Check the browser console for error messages
- Verify the backend server is running
- Test with different websites
- Check the troubleshooting section above
This project is for educational purposes. Please respect the terms of use for any translation APIs you integrate.