title: Microservices Architecture for Audit Pipeline

content: The system uses a microservices architecture with distinct services for API validation (AuditRequestAPI), scraping (PlaywrightRunner), data enrichment (ExternalDataFetcher), AI analysis (AIAnalyzer), and report generation (ReportGenerator). This modular approach allows independent scaling and failure isolation compared to a monolithic audit script.


title: Redis Queue-Based Asynchronous Processing

content: The pipeline uses Redis queues (AuditQueue, DataProcessingQueue, ReportGenerationQueue, NotificationQueue) to decouple services and achieve sub-60-second audit generation. This asynchronous architecture allows the user to receive an immediate response while processing happens in the background.


title: n8n Workflow Orchestration

content: n8n serves as the orchestration layer, listening to Redis queues and triggering subsequent microservices. This visual workflow tool simplifies complex pipeline coordination and allows non-developers to modify flows.


title: MinIO Self-Hosted Storage

content: The system uses MinIO for storing screenshots, videos, and reports instead of AWS S3 to avoid per-request storage costs. MinIO provides S3-compatible API with self-hosting economics.


title: Playwright Anti-Detection Configuration

content: The scraper uses playwright-extra with user-agent rotation, proxy rotation, and anti-detection plugins to bypass bot protection. Graceful degradation returns informative messages if blocked rather than breaking the funnel.


title: White-Label Agency ID Propagation

content: The agency_id is passed through the entire pipeline (from API through scraping, analysis, and report generation) to enable multi-tenant white-label reports with agency branding injected via Jinja2/Handlebars templates.


title: Sunaiva Radar Audit Engine - 7-Stage Pipeline

content: Automated website audit system with 7 stages: (1) User Input & Validation via AuditRequestAPI, (2) n8n Orchestration, (3) Playwright Scraper with desktop/mobile screenshots and Lighthouse checks, (4) External Data Fetcher (SimilarWeb, optional Moz/Ahrefs), (5) AI Analyzer using Gemini Flash and Qdrant RAG, (6) Report & Video Generator with white-label branding, (7) Notification with email and Telnyx outbound call within 2 minutes.


title: Scoring Algorithm Dimensions

content: Multi-dimensional scoring system with weights: Design (15% - speed/performance 50%, visual consistency 20%, modernity/accessibility 20%, broken elements 10%), Content (20%), SEO (30%), Lead Capture (25%), Mobile (10%). Each metric scored 0-10, normalized to 0-100 dimension score. Target range 40-70 for credibility with visible improvement opportunities.


title: Video Walkthrough Generation

content: Report includes video walkthrough with AI voice-over reading key audit sections over screenshots. Simpler and faster than browser replay, fits within 60-second target.


title: 7-Stage Audit Pipeline Execution Order

content: The audit pipeline executes in specific order: (1) AuditRequestAPI validates URL/email/phone and pushes to Redis AuditQueue, (2) n8n workflow triggers PlaywrightRunner, (3) PlaywrightRunner captures screenshots/DOM and pushes to DataProcessingQueue, (4) ExternalDataFetcher enriches with SimilarWeb data, (5) AIAnalyzer applies scoring algorithm, (6) ReportGenerator creates HTML/video with white-label branding, (7) Notification workflow sends email and triggers Telnyx call.


title: Design Scoring Dimension Breakdown

content: Design dimension (15% weight) scored via: Speed & Performance (50% - LCP, CLS, FCP from Lighthouse), Visual Consistency (20% - font/color palette analysis), Modernity & Accessibility (20% - viewport, contrast, ARIA), Broken Elements (10% - 404 links/images).


title: Anti-Detection Scraping Capability

content: The combination of playwright-extra, user-agent rotation, proxy rotation, and graceful degradation for CAPTCHAs creates a defensible scraping capability that competitors would struggle to replicate without significant investment.


title: Multi-Tenant White-Label Architecture

content: The agency_id propagated through the entire pipeline with white-label branding injection enables agencies to offer audits under their own brand, creating a B2B2C distribution moat that drives adoption through agency partners.


title: Sub-60-Second Speed Target

content: The architectural focus on sub-60-second audit generation through asynchronous queues and efficient pipeline design creates a speed competitive advantage that establishes market positioning.


title: SimilarWeb Caching Strategy

content: SimilarWeb API calls are cached for popular domains to reduce external API costs. This caching layer prevents redundant calls for frequently audited websites.


title: Target Score Range 40-70

content: The scoring algorithm targets 40-70 range for most businesses - credible enough to show the business has some merit, but with visible gaps that create urgency for improvement without appearing fake or panic-inducing.


title: Loss Aversion in Audit Reporting

content: The audit report leverages loss aversion by highlighting critical issues (scores below 40) that represent potential revenue leaks, converting abstract technical problems into tangible business costs.


title: Redis Queue Integration

content: Redis serves as the central integration point connecting all microservices: AuditRequestAPI pushes to AuditQueue, PlaywrightRunner pushes to DataProcessingQueue, AIAnalyzer pushes to ReportGenerationQueue, ReportGenerator pushes to NotificationQueue. n8n listens to queues to trigger downstream services.


title: Telnyx Voice Integration

content: Telnyx provides outbound calling capability within 2 minutes of audit completion. The NotificationQueue triggers Telnyx API to place automated follow-up calls to leads, integrating voice communication into the automated funnel.


title: CRM Integration via agency_id

content: The agency_id enables CRM integration - agency-specific CRM systems receive lead data with attribution tracking which agency generated which lead, closing the loop between audit generation and sales follow-up.


title: Qdrant RAG Integration

content: Qdrant provides RAG (Retrieval-Augmented Generation) capability for the AIAnalyzer, storing industry benchmarks and best practices to inform scoring and provide context-aware recommendations during analysis.


title: Playwright Scraper Service Implementation

content: PlaywrightRunner containerized service captures desktop and mobile screenshots, extracts HTML/CSS/JS and DOM data, runs Lighthouse checks for performance/accessibility/mobile, detects forms/chat widgets/schema markup, checks broken links/images. Uses playwright-extra with user-agent and proxy rotation for anti-detection.


title: AI Analyzer Service Implementation

content: AIAnalyzer Python service uses Gemini Flash for content analysis, design feedback, readability, tone, and CTA clarity. Queries Qdrant RAG for industry benchmarks. Applies the multi-dimensional scoring algorithm. Outputs AuditResult JSON to ReportGenerationQueue.


title: Report Generator Service Implementation

content: ReportGenerator service injects audit data into HTML templates using Jinja2/Handlebars, applies white-label branding based on agency_id, generates video walkthrough with AI voice-over reading key sections over screenshots. Outputs report URL and video URL to NotificationQueue.


title: Tech Stack Summary

content: Complete tech stack: Queues (Redis), Orchestration (n8n), Scraping (Playwright Python/Node), AI (Gemini Flash, Qdrant), Database (PostgreSQL structured, Redis cache/queue), Storage (MinIO), Templating (Jinja2/Handlebars), Voice (Telnyx), Hosting (Elestio).


title: Graceful Degradation for Blocking

content: The system implements graceful degradation - if Playwright is blocked by CAPTCHAs or anti-bot measures, it returns an informative message rather than failing completely. This prevents the funnel from breaking when scraping encounters obstacles.