How arturovaine/company-risk-radar_web-extension works
Project type and purpose
• This is a Chrome browser extension (Proof of Concept) that provides a popup UI to run “due diligence” company investigations by calling the OpenAI GPT‑4 API, structuring the results into JSON, and allowing the user to download that JSON.
File structure
• manifest.json: Chrome extension manifest (defines the popup, permissions, storage usage).
• .gitignore / README.md: Project metadata (not part of runtime).
README for additional insights
• It describes how the extension stores the OpenAI key in chrome.storage, builds a prompt based on the user’s requested company, sends that prompt to GPT‑4, parses the JSON response, and displays or downloads it.
• The tech stack is plain HTML/CSS/JS and Chrome Extension APIs (storage, action) plus the external OpenAI API.
Main components & their interactions
a. Browser & Chrome Extension Host
b. Popup UI (popup.html + popup.js)
• Retrieves the stored API key from chrome.storage.
• Renders an input for the company name.
• On submit, constructs the GPT‑4 prompt and sends an HTTPS request to the OpenAI API.
• Receives JSON results, displays them in the popup, and offers a “Download JSON” button.
c. Chrome Storage
• Holds the user’s OpenAI API key and (in future) custom prompts or history.
d. OpenAI GPT‑4 External Service
• Receives the assembled prompt, returns a structured JSON report with risk fields and score.
e. User
• Interacts with the popup UI, initiates analyses, and downloads or reviews results.
Architectural patterns & design principles
• Single‑page popup architecture—no background or content scripts here.
• Use of browser‑provided storage for secrets.
• External service integration via REST.
• Popup UI → Chrome Storage: fetch API key.
• Popup UI → OpenAI API: POST prompt, await JSON.
• OpenAI API → Popup UI: returns JSON report.
• Popup UI → User: renders data, downloads JSON.