DEV Community

Shahzaib
Shahzaib

Posted on

I Added 11 AI Tools to My Free PDF Site Overnight — Here's the Architecture

I Added 11 AI Tools to My Free PDF Site Overnight — Here's the Architecture

Last night I shipped something wild: 11 AI-powered tools on PdfWord (my free PDF tools site), taking it from 36 to 47 tools in one night. AI PDF summarizer, MCQ generator, chat-with-PDF, contract risk detector, handwriting OCR, design-to-code — all free, no signup.

Here's exactly how I built it for $0/month.

The Architecture

Frontend: Static site on Cloudflare Pages. PDF text extraction happens in the browser with pdf.js — the file never leaves the user's device.

Backend: One Cloudflare Worker as a secure proxy. The browser sends extracted text → Worker forwards to Gemini → returns the answer. The API key lives as a Worker secret — never exposed to the client.

Why a proxy? Calling Gemini directly from the browser would leak the API key. The Worker also enforces:

  • Strict CORS (only my domain)
  • Origin validation (blocks non-browser abuse)
  • Rate limiting (30 req/min per IP — protects the free quota)
  • Model fallback (if one model is busy, try the next)

The 11 Tools

Text-based (same pipeline, different prompts):

  1. AI PDF Summarizer — summary, key points, custom Q&A
  2. MCQ Generator — textbook chapter → quiz with answers (EdTech traffic gold)
  3. Chat with PDF — 100-page docs, conversational Q&A ($15-20/mo elsewhere, free here)
  4. AI Compare — old vs new agreement, every change listed
  5. Contract Risk Detector — red flags, hidden penalties, unfair clauses
  6. Proposal Writer — resume + job description → tailored cover letter
  7. Manual Explainer — complex engineering docs in simple words
  8. Invoice Extractor — supplier catalog → Product/Price/SKU Excel
  9. PDF to Data — any PDF → structured JSON/Excel

Vision-based (page rendered to image → Gemini vision):

  1. Super OCR — reads handwriting, prescriptions, blurry scans
  2. Design to Code — PDF wireframe → HTML/CSS

The Model Situation

gemini-1.5-flash (my original plan) is dead. gemini-2.5-flash says "no longer available to new users." The working model is gemini-3.8-flash — with gemini-3.5-flash and gemini-flash-latest as fallbacks. Lesson: always build model fallback, Google renames things fast.

Cost

$0. Cloudflare Workers free tier: 100,000 requests/day. Gemini free tier: generous enough for a growing tools site. Total infrastructure cost: nothing.

What I'd Do Differently

  • Streaming responses — currently returns full text at once; SSE streaming would feel faster
  • Chunked summarization — for 100+ page docs, map-reduce would beat single-shot
  • Usage dashboard — track which tools get used to guide what to build next

The site: https://pdfwordtools.pages.dev — 47 free tools, no signup, no watermark.


Built with Cloudflare Workers + Google Gemini. Total AI tools shipped in one night: 11.

Top comments (0)