Documentation

Comprehensive guide to the YooHoo Search ecosystem.

Introduction

YooHoo is a privacy-first, client-heavy search engine designed to operate with minimal server-side dependency. It leverages Edge Computing (Cloudflare Workers, Vercel) and client-side scraping fallback to deliver results without tracking user data.

Quick Start

Installation

Clone the repository and serve the static files. No build process is required for the core engine.

git clone https://github.com/generic/yoohoo-search.git
cd public
python3 -m http.server 8080

Architecture

Directory Structure

/public
├── assets/         # Core JS logic (search.js) & CSS
├── ai/             # AI Persona definitions & Prompts
├── api/            # Developer Portal
├── docs/           # You are here
└── index.html      # Main Entry Point

The application follows a modular "Micro-Frontend" approach where each section (API, Docs, Dashboard) is a self-contained static app sharing common assets.

Search Engine Logic

The Fallback Cascade

Search resilience is achieved through a 3-tier system. If the primary API fails, the browser attempts to fetch results directly.

  • Tier 1: Cloudflare Edge - Primary API. Low latency (< 50ms).
  • Tier 2: Browser Scraper - ScraperService fetches HTML from DuckDuckGo/Brave via CORS proxy.
  • Tier 3: Direct Link - User is offered a direct link to Google/Bing.

Scrapers

ScraperService

Located in assets/scrapers.js, this service implements a "race" mechanism.

// Example: Race multiple providers
async race(fetchers) {
  return await Promise.any(fetchers.map(f => f()));
}

It simultaneously queries multiple decentralized instances (e.g., Invidious for video) and returns the first successful response.

AI Integration

The AI Summary feature uses a streaming response model. Config is stored in ai/config.js.

Error Codes

  • 404: Quantum Desync (Page not found)
  • 503: Edge Worker Unavailable (Triggers Scraper Fallback)
  • 429: Rate Limit Exceeded (Too many AI requests)