Skip to content

Prayash007/Leetcode_helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Chrome Extension with Gemini API

A lightweight Chrome Extension powered by JavaScript that communicates with a local server using the Gemini API.


📦 Prerequisites


🔧 Installation & Setup

1. Clone the Repository

git clone https://github.com/your-username/your-extension-repo.git
cd your-extension-repo

2. Install Server Dependencies

cd server
npm install

3. Add Your Gemini API Key

Create a .env file in the server directory:

touch .env

Add this line inside .env:

GEMINI_API_KEY=your_api_key_here

🚀 Start the Server

npm start

This will start your server on the default port (e.g., http://localhost:3000).


🧩 Load the Chrome Extension (Developer Mode)

  1. Open Chrome and navigate to chrome://extensions/.
  2. Enable Developer Mode (top right toggle).
  3. Click on Load unpacked.
  4. Select the extension folder from this project.

💡 Usage

  1. Navigate to a supported page (e.g., LeetCode).
  2. Click the extension icon in the toolbar.
  3. The extension will interact with your local server using your Gemini API key.

🛠️ Project Structure

📁 extension/
📁 server/
  ├─ .env
  ├─ index.js
  └─ ...

🧪 Test the API Endpoint

Use a tool like Postman or cURL:

curl -X POST http://localhost:3000/gemini \
-H "Content-Type: application/json" \
-d '{"prompt": "Summarize this paragraph..."}'

📝 Notes

  • Keep your .env file private.
  • Ensure the server is running before using the extension.
  • Chrome extension requests are routed to the local server.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published