How supritha-kamalanathan/email-summarizer-groq works
Main Components
• Chrome Extension (Frontend):
• Contains the user interface (popup.html and popup.js) and a manifest file (manifest.json) for Chrome integration.
• Enables file selection (drag-and-drop or click) for email files.
• FastAPI Backend:
• Main module in backend/main.py with requirements listed in requirements.txt.
• Provides a REST API endpoint (POST /summarize) that accepts email batches.
• Handles encryption (Fernet) for email data and implements security features including CORS protection, rate limiting, and file size restrictions.
• External AI Service:
• Groq’s Mixtral-8x7b model utilized via the Groq API to process and summarize email content.
• Supporting Elements:
• .env configuration file for environment variables.
• Security layer managing encryption and access controls.
Relationships and Interactions
• The Chrome Extension is the primary entry point for the user. It interacts with the backend by sending email content via the POST /summarize API endpoint.
• The FastAPI backend receives the data, applies security measures (encryption/decryption), and then sends the email data to Groq’s AI service.
• The AI service processes the data and returns a summary, which the backend then sends back to the Chrome extension.
Architectural Patterns and Technologies
• Separation of Concerns: Clear split between frontend (Chrome extension) and backend (FastAPI).
• RESTful API: The backend exposes endpoints (e.g., POST /summarize) to handle requests from the Chrome extension.
• Security by Design: Incorporates symmetric encryption (Fernet), CORS protection, and rate-limiting.
• Integration with Third-Party AI: The backend handles communication with Groq’s API for email summarization.
• Deployment and configuration management through environment files (.env).