| name | brightdata-reference-architecture |
| description | Implement Bright Data reference architecture with best-practice project layout.
Use when designing new Bright Data integrations, reviewing project structure,
or establishing architecture standards for Bright Data applications.
Trigger with phrases like "brightdata architecture", "brightdata best practices",
"brightdata project structure", "how to organize brightdata", "brightdata layout".
|
| allowed-tools | Read, Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","scraping","data","brightdata"] |
| compatibility | Designed for Claude Code |
Bright Data Reference Architecture
Overview
Production-ready architecture for Bright Data scraping systems. Covers project layout, data pipeline design, and integration patterns for Web Unlocker, Scraping Browser, SERP API, and Datasets API.
Prerequisites
- Understanding of layered architecture
- Node.js/TypeScript project setup
- Database for storing scraped data
Project Structure
my-scraper/
โโโ src/
โ โโโ brightdata/
โ โ โโโ proxy.ts # Proxy config helper (zone, country, session)
โ โ โโโ client.ts # Axios client with proxy + retry
โ โ โโโ browser.ts # Scraping Browser connection manager
โ โ โโโ api.ts # REST API client (trigger, snapshot)
โ โ โโโ cache.ts # Response cache (LRU + optional Redis)
โ โ โโโ types.ts # Shared TypeScript interfaces
โ โโโ scrapers/
โ โ โโโ product-scraper.ts # Domain-specific scraper
โ โ โโโ serp-scraper.ts # Search result collector
โ โ โโโ parser.ts # HTML โ structured data (cheerio)
โ โโโ pipeline/
โ โ โโโ scheduler.ts # Cron-based scraping scheduler
โ โ โโโ processor.ts # Raw HTML โ clean data
โ โ โโโ storage.ts # Database/file output
โ โโโ webhooks/
โ โ โโโ brightdata.ts # Webhook delivery handler
โ โโโ api/
โ โโโ health.ts # Health check endpoint
โ โโโ scrape.ts # On-demand scrape endpoint
โโโ tests/
โ โโโ unit/ # Mocked tests (no proxy needed)
โ โโโ integration/ # Live proxy tests
โ โโโ fixtures/ # Cached HTML for testing
โโโ config/
โ โโโ zones.json # Zone configuration per environment
โ โโโ targets.json # Target URLs and scraping schedules
โโโ .env.example
Architecture Diagram
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API / Scheduler โ
โ (On-demand scrape, cron jobs, webhooks) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Scraper Layer โ
โ (Product scraper, SERP scraper, custom parsers) โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโค
โ Web โ Scraping โ SERP / Datasets โ
โ Unlocker โ Browser โ API โ
โ (Proxy) โ (WebSocket) โ (REST) โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโค
โ Bright Data Infrastructure Layer โ
โ (Proxy config, retry, cache, session management) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Storage / Pipeline โ
โ (Database, file output, webhook delivery) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Components
Step 1: Multi-Product Client