A powerful Chrome Extension that allows users to summarize selected or input text using GPT-based AI summarization via a secure backend API deployed on Fly.io.
- 🔍 Right-click selected text → Summarize
- 💬 Input text manually from popup
- 🛡️ Uses backend API (no API key exposed on frontend)
- 🚀 Built with FastAPI, deployed on Fly.io
- ✅ Summarize any selected text on a webpage with one click
- ✅ Uses OpenAI GPT-4.0 API via a secure backend
- ✅ Clean UI with popup form
- ✅ Free-tier token authentication
- ✅ Rate-limiting (in-memory logic)
- ✅ Easy to deploy and extend
| Frontend (Extension) | Backend API | Deployment |
|---|---|---|
| HTML + JS + Manifest | Python + FastAPI | Fly.io |
| Chrome Context Menus | OpenAI SDK (v1+) |
git clone https://github.com/calvinlee326/summary-extension.git
cd summary-extension-
Go to
chrome://extensions -
Enable Developer Mode
-
Click "Load Unpacked"
-
Select the root folder containing:
├── manifest.json ├── popup.html ├── popup.js ├── background.js ├── icons/*.png
✅ You will see the extension icon in your toolbar.
- Select any text on a webpage
- Right-click →
Summarize Selection - Popup will auto-open and show a summarized version
- Click the extension icon
- Paste any long text
- Click Summarize → AI-generated summary appears
cd backend-api
python3 -m venv myenv
source myenv/bin/activate
pip install -r requirements.txtCreate a .env file:
OPENAI_API_KEY=sk-...your-real-key...uvicorn main:app --reloadTest with:
curl -X POST http://127.0.0.1:8000/summarize \
-H "Content-Type: application/json" \
-d '{"token": "demo123", "text": "OpenAI builds ChatGPT."}'brew install flyctl
fly auth logincd backend-api
fly launch
# Accept prompts, set app name e.g., summary-api
fly deployYour API will be live at:
https://summary-api.fly.dev/summarize
✅ Make sure
.envhas been added withfly secrets:
fly secrets set OPENAI_API_KEY=your-keyEndpoint:
POST /summarize
Request:
{
"token": "demo123",
"text": "Your long input text here..."
}Response:
{
"summary": "- Bullet 1...\n- Bullet 2..."
}- API Key is never exposed in the Chrome Extension.
- Free-tier token is used for testing (
demo123) — you can replace it with JWT or user login for production. - In-memory rate limiting can be replaced by Redis or DB-based logic if needed.
- User login and auth
- History of past summaries
- PDF or DOCX summarization
- Multi-language support
MIT License © 2025 Calvin Lee
This extension does not collect or store any personal user data. All text processing is done by sending selected text to a secure backend API for summarization. No information is retained after processing.