Skip to content

feat: self-hosted crawler service that produces screenshots + DESIGN.md - #4

Draft
riteshbonthalakoti wants to merge 5 commits into
claude/firecrawl-crawl-providerfrom
claude/crawler-service
Draft

riteshbonthalakoti wants to merge 5 commits into
claude/firecrawl-crawl-providerfrom
claude/crawler-service

Conversation

@riteshbonthalakoti

@riteshbonthalakoti riteshbonthalakoti commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

What

Stacked on #3 (base is that branch; GitHub retargets to main once #3 merges).

Adds crawler/, a small containerized service that opens the target URL in a real headless Chromium and returns what the roast needs:

  • full-page desktop screenshots pre-cropped into 900px sections (max 18) + two 390px mobile shots
  • designMd: a factual DESIGN.md with theme colors and CSS variables, typography, layout (container width, radii), CTA table (above-the-fold, contrast, generic labels), content outline, trust signals, measured WCAG contrast failures, mobile tap-target/overflow/viewport checks, transfer sizes + LCP/CLS, SEO, up to two other pages (pricing/about), and the page's verbatim text

lib/crawler.ts calls it once per audit (shared by all five crawl helpers) and lib/screenshot.ts now tries: crawler service → Firecrawl (#3) → legacy thum.io/Jina. The crawler's DESIGN.md replaces the markdown, regex and subpage inputs, so the roast is grounded in rendered, measured data and exact quotes. With CRAWLER_URL/CRAWLER_TOKEN unset, behavior is unchanged.

Why

Opening a site and taking a screenshot loses the layout/theme/content the roast should talk about. This runs the app in a browser in our own container and extracts it.

Safety

Bearer auth required (refuses to start without CRAWLER_TOKEN); every navigation/subresource host is resolved and blocked if private/loopback/link-local/CGNAT/multicast; concurrency cap and hard timeout. Known limit: DNS rebinding between check and connect (noted in crawler/README.md).

Type

  • New feature

Checklist

  • npx tsc --noEmit and npx eslint pass
  • Ran the service locally against example.com, linear.app, stripe.com, craigslist.org: 1/11/17/7 desktop sections, mobile pass, real transfer sizes, SSRF/auth cases return 401/422
  • Ran the app helpers against it: one crawl serves all helpers; falls back to null when the crawler is down
  • Not deployed anywhere yet; not tested from Vercel
  • npm run build not run here (sandbox lacks Stripe/Resend env vars; see test: add Vitest suite covering AI fallback, rate limiter, audit scoring, admin auth #1)

Needs before it is used

  • Pick a container host and deploy crawler/ (see crawler/README.md), then set CRAWLER_URL and CRAWLER_TOKEN in Vercel (Production and Preview)
  • Bot-protected sites may still block datacenter IPs; the app falls back to Firecrawl when the crawler reports a block page
  • Not in this PR: feeding the mobile screenshots to the vision model, per-dimension slicing of DESIGN.md to cut prompt tokens

…ESIGN.md

Opens the URL in headless Chromium (desktop 1280px + iPhone 13 mobile pass),
scrolls to trigger lazy content, and returns 900px screenshot sections plus a
factual DESIGN.md: theme, typography, layout, CTAs, trust signals, measured
WCAG contrast, mobile tap targets/overflow, transfer sizes and web vitals,
SEO and verbatim page text. Bearer auth, SSRF guard on every request host,
concurrency limit and hard timeout. Ships with a Dockerfile.
Order is crawler service, then Firecrawl, then the legacy thum.io/Jina path.
DESIGN.md replaces the markdown, raw-HTML regex and subpage text when the
crawler succeeds.
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
roastlab Error Error Nov 3, 2026 8:57am UTC

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

This branch had an error being deployed

1 failed deployment
Preview — f2d2254c Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants