How thakare-om03/cold-email-generator works
Project Type & Purpose
• Type: A full‑stack (but Python‑centric) web application with a UI, business logic, local data store, and external AI service.
• Purpose: Scrape job listings, extract requirements via LLM, match to portfolio items, generate personalized cold‑email drafts, and optionally schedule automated runs.
File Structure
• Top‑level:
– .devcontainer: development container config
– app/: Python source (UI + business logic)
– my_portfolio.csv: user‑provided portfolio data
– vectorstore/: local Chroma vector DB files
– output/: generated images for documentation
– requirements.txt: dependencies
• Within app/:
– main.py: Streamlit app entrypoint (UI pages, navigation)
– chains.py: LangChain workflows (job analysis, email gen)
– job_automation.py & run_automation.py: scheduler components
– portfolio.py: CSV upload & vectorstore indexing
– utils.py: shared helpers
Extract Key Architecture Insights from README
• UI: Streamlit front‑end
• AI Service: GROQ API via LangChain
• Data Store: Chroma (vectorstore directory + SQLite)
• Scheduler: Cron‐like automated job runs
• Email Integration: Redirect to Gmail/Outlook
Main Components & Interactions
a. Components:
1. Client Browser
2. Streamlit Server (app/main.py)
3. Portfolio Manager (app/portfolio.py + my_portfolio.csv)
4. Vectorstore (ChromaDB in vectorstore/)
5. Job Scraper & Analyzer (app/chains.py, job_automation.py)
6. AI/Text Generation (GROQ API via LangChain)
7. Scheduler (app/run_automation.py)
8. Email Client (external)
b. Interactions / Data Flow:
• User → Streamlit UI (configure API key, upload portfolio)
• UI calls Portfolio Manager → indexes CSV → stores embeddings in Chroma
• User submits job URLs/keywords → Chains invoke scraper → extract text
• Chains send job text + portfolio embeddings to LangChain → invokes GROQ → returns requirements & email drafts
• Results displayed in UI → “Send Email” button → triggers mailto link or Gmail/Outlook redirect
• Scheduler triggers job scraping/email gen at configured intervals (using job_automation & run_automation)
c. Architectural Patterns & Design Principles:
• Modular Code: separation of UI (main.py), business logic (chains.py), data layer (portfolio.py)
• Layered Architecture: UI Layer → Service Layer (LangChain workflows) → Data Layer (Chroma vectorstore) → External Services (GROQ API, Email Client)
• Dependency Injection: API key via .env
• Event‑Driven / Cron Pattern for automation
d. Key Technologies/Frameworks:
• Python + Streamlit (UI)
• LangChain + GROQ API (LLM orchestration)
• ChromaDB (vector embeddings store)
• CSV for portfolio data storage
• Scheduled tasks (python scripts invoked by OS scheduler or Streamlit background threads)
• Optional email client protocols (mailto, Outlook APIs)