Repository navigation
feat: self-hosted crawler service that produces screenshots + DESIGN.md - #4
Draft
riteshbonthalakoti wants to merge 5 commits into
Draft
riteshbonthalakoti wants to merge 5 commits into
riteshbonthalakoti wants to merge 5 commits into
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. CodeRabbit Verify
|
2 of 4 tasks
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stacked on #3 (base is that branch; GitHub retargets to
mainonce #3 merges).Adds
crawler/, a small containerized service that opens the target URL in a real headless Chromium and returns what the roast needs: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 textlib/crawler.tscalls it once per audit (shared by all five crawl helpers) andlib/screenshot.tsnow 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. WithCRAWLER_URL/CRAWLER_TOKENunset, 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 incrawler/README.md).Type
Checklist
npx tsc --noEmitandnpx eslintpassnullwhen the crawler is downnpm run buildnot 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
crawler/(seecrawler/README.md), then setCRAWLER_URLandCRAWLER_TOKENin Vercel (Production and Preview)