A Chrome extension powered by Google's Gemini API to help you learn and solve LeetCode problems more effectively.
- Next Step Mode: Get step-by-step guidance on how to solve the current problem
- Hint Mode: Receive helpful hints without complete solutions
- Multi-Language Support: Works with:
- Python
- JavaScript
- Java
- C++
- Clone the repository:
git clone https://github.com/yourusername/SensAI.git
cd SensAI- Set up the backend:
cd backend
pip install -r requirements.txt-
Configure your Gemini API key:
- Create a
.envfile in the backend directory - Add your API key:
GEMINI_API_KEY=your_api_key_here
- Create a
-
Load the extension in Chrome:
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
extensiondirectory from this project
- Open Chrome and go to
- Visit any LeetCode problem page
- Click the SensAI extension icon
- Select your preferred mode:
- "Next Step" for guided solution steps
- "Get Hint" for subtle hints
- Choose your programming language
- Click "Get Assistance"
SensAI/
├── backend/
│ ├── server.py # Flask server handling Gemini API requests
│ └── requirements.txt # Python dependencies
├── extension/
│ ├── manifest.json # Extension configuration
│ ├── popup/
│ │ ├── popup.html # Extension popup interface
│ │ ├── styles.css # Popup styling
│ │ └── script.js # Popup functionality
│ └── content/
│ └── content.js # LeetCode page interaction
└── README.md
The backend server provides two main endpoints:
/next_code: Generates the next logical step in solving the problem/hint: Provides a helpful hint without giving away the solution
- Python 3.8+
- Flask
- google-generativeai
- python-dotenv
- The extension uses vanilla JavaScript
- Styling follows a dark theme with orange accents
- Uses Chrome's Extension Manifest V3
The extension includes robust error handling for:
- API connection issues
- Code extraction failures
- Invalid responses
- Rate limiting
- API keys are stored server-side only
- No sensitive data is stored in the extension
- All API calls are made through the backend server
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google's Gemini API for powering the AI assistance
- LeetCode for providing the platform for coding practice
- The open-source community for various tools and libraries used
For issues, questions, or contributions, please open an issue in the GitHub repository.