How zachrattner/scourhead works
Main Components
a. User Interface Layer (Electron App)
• Main window components (setup-*.html files)
• Debug logging interface (debug-log.html)
• CSS theming system
b. Core Processing Layer
• Project Management
• Search Query Generation
• Browser Automation
• LLM Integration
• Data Extraction
• Export Functionality
c. External Services Integration
• Search Providers (Google, Bing, DuckDuckGo)
• Ollama LLM Service
• Playwright Browser Automation
┌─ User Interface Layer ─────────────────────┐
• ┌─────────┐ ┌─────────┐ ┌─────────────┐ │
• Setup UI │ │Debug UI │ │Results View │ │
• ┘ └─────────┘ └─────────────┘ │
• Core Processing Layer ───────────────────┐│
• ┌─────────┐ ┌─────────┐ ┌─────────────┐ │
• Project │ │Search │ │Data │ │
• Manager │ │Engine │ │Processor │ │
• ┘ └─────────┘ └─────────────┘ │
• Service Integration Layer ───────────────┤│
• ┌─────────┐ ┌─────────┐ ┌─────────────┐ │
• Search │ │Ollama │ │Playwright │ │
• Providers│ │LLM │ │Browser │ │
• ┘ └─────────┘ └─────────────┘ │
• ┘
Key Relationships to Highlight
a. Data Flow
• User input → Query Generation → Search Execution
• Search Results → LLM Processing → Structured Data
• Structured Data → CSV Export
b. Service Integration
• Core → Search Providers
• Core → Ollama LLM
• Core → Playwright Browser
Important Implementation Details
• Separation between main process (src/main.ts) and renderer processes
• Role of preload scripts (src/preload.ts)
• File storage system for .scour files
• Stages pipeline from the src/util/stages directory
Technical Stack Indicators
• Electron
• TypeScript
• Playwright
• Ollama/Llama 3.2
• HTML/CSS