@react-pdf/renderer — the same React components used in the browser PDF viewer are rendered to a binary stream on the server, uploaded to AWS S3, and delivered to users via a presigned download URL.
Report Types
Full Report
All four metrics — Accessibility, Performance, SEO, Quality — across all scanned pages. Multi-page PDF with per-page breakdowns and WCAG issue lists.type:
"full"Accessibility Report
Accessibility-only audit. Detailed WCAG level breakdown (A, AA, AAA), issue checklist, and affected page list.type:
"accessibility"Single Page
Compact single-page summary with headline scores and top issues only. Used for quick sharing.type:
"singlePage"PDF Data Schema
Thereport payload in POST /api/v1/report must conform to this structure:
Top-level PDFData
Metrics object
MetricsScore object
Full request example
Generation Pipeline
1
Request received
POST /api/v1/report validates the body and enqueues a BullMQ job with removeOnComplete: true and removeOnFail: true. The job name is auditReport-{REPORT_ENV}.2
Template selection
create-template.tsx maps the type field to a React-PDF component:3
Font loading
The Inter font (weights 100–900) is registered with React-PDF via
Font.register() pointing to Google Fonts CDN. This runs once at server start.4
Render to stream
ReactPDF.renderToStream(component) renders the component to a Node.js readable stream. Stream chunks are collected into a Buffer.5
Upload to S3
uploadToS3(buffer, auditId) calls PutObjectCommand with ContentType: "application/pdf". The S3 key is the audit_id.6
Email notification
sendEmail({ email, template: "report", data: { reportUrl, url, score } }) sends the report-ready email via Resend.PDF Download
Reports are accessed via a presigned S3 URL, not served directly:Presigned URLs expire after 1 hour (3600 seconds). If you need a longer-lived link, re-request the download endpoint to generate a fresh URL.
S3 Storage Layout
All PDFs are stored in thewebyes-report bucket (region: eu-west-2):
Frontend PDF Viewer
The Vite frontend (src/App.tsx) renders the same PDF components in the browser for preview/development: