How danikagupta/chrome_summary works
Project type and purpose
• This is a hybrid full-stack/local application with two UIs:
• A Streamlit Python “backend + UI” service (app.py) that calls OpenAI
• A Chrome Extension (background.js, popup.html/js) for page content extraction
• Purpose: extract the current Chrome tab’s content, send it to GPT-4.1-mini, and display a summary.
Main components
a. Chrome Extension
– Content Script / background.js: reads the active tab’s DOM
– popup.html / popup.js: provides a minimal user trigger UI in Chrome
b. Streamlit App (app.py)
– Frontend: Streamlit UI for showing and interacting with summaries
– Backend: Python logic that accepts page text, stores API key locally, invokes OpenAI
c. Local Storage
– A file or keychain holding the user’s OpenAI API key
d. External Service
– OpenAI GPT-4.1-mini API endpoint
e. Documentation (vertical column)
– documentation/PRD.md, EDD.md, DEPLOYMENT.md, requirements.md, README.md
Relationships and data flows
1) User clicks Chrome extension → extension grabs page content → sends content payload to local Streamlit server API (HTTP request)
2) Streamlit app receives payload → fetches user’s API key from local storage → calls OpenAI API → receives summary
3) Streamlit app displays summary in its web UI
4) Optionally, the extension’s popup could open the Streamlit UI or show the summary inline
Architectural patterns & design principles
• Separation of concerns:
• Extension solely handles page extraction & UI trigger
• Streamlit app handles orchestration, API calls, and final UI
• Single-process local service (no microservices)
• Secure local storage (API key never leaves user’s machine except to OpenAI)
Positioning the documentation vertically
• Stack entries top to bottom in this column:
• README.md
• PRD.md
• EDD.md
• DEPLOYMENT.md
• requirements.md
Final checklist
– All components labeled clearly
– Documentation in its own vertical column
– Note any ports or URLs (e.g., Streamlit default 8501)