How vishnuviez/smartpdf works
Purpose and Runtime
This is a Next.js App Router application for browser-based PDF utilities, conversion tools, and related marketing content. The primary entry point is app/page.js; global document structure and styling originate in app/layout.js and app/globals.css. It runs as a Node.js/Next.js application and includes Netlify deployment configuration in netlify.toml.
Route Structure
Tool capabilities are exposed as route segments under app/tools, each with a page and route-local layout. Major user-facing workflows include compression (app/tools/compress/page.js), merging (app/tools/merge/page.js), editing (app/tools/edit/page.js), image conversion (app/tools/images-to-pdf/page.js), OCR (app/tools/ocr/page.js), and document export formats such as app/tools/pdf-to-word/page.js and app/tools/pdf-to-excel/page.js.
Shared Upload and File Interaction Layer
The reusable UI boundary for file-oriented workflows is concentrated in:
• app/components/Dropzone.js
• app/components/FileList.js
• app/lib/pdf-utils.js
Tool pages likely compose the drop zone and file-list components, while PDF-oriented transformations are centralized behind the PDF utility module rather than embedded in every page. This separates browser interaction/state from document manipulation behavior.
Tool Processing Flows
The core flow is: user navigates to a tool route, selects or drops one or more files, configures a tool-specific operation, invokes client-side or API-backed processing, then receives a transformed/downloadable artifact. Multi-file operations are represented by merge (app/tools/merge/page.js), organize (app/tools/organize/page.js), and split (app/tools/split/page.js); document mutation tools include rotate, watermark, protect, unlock, page numbering, and signing under app/tools/*/page.js.
Server API Boundaries
Two Next.js route handlers define server-side integration points:
• app/api/checkout/route.js
• app/api/gemini/route.js
Checkout is the payment/subscription boundary associated with the pricing surface in app/pricing/page.js. Gemini is an external AI-service boundary, likely used for AI-assisted document functionality; its credentials and provider invocation should remain server-side within this handler rather than in tool pages.
Content and Acquisition Surface
The application includes static SEO/editorial routes under app/blog, with a blog index at app/blog/page.js and PDF-task articles such as app/blog/how-to-merge-pdf-files-free/page.js. Shared site navigation is represented by app/components/Header.js. These routes feed users toward the interactive tool routes rather than participating in document processing.
Infrastructure and Key Boundaries
Next.js configuration is in next.config.mjs; package/runtime dependencies are defined by package.json. Deployment is explicitly prepared for Netlify via netlify.toml, despite the generic README mentioning Vercel. The principal trust boundaries are browser file input versus processing code, client pages versus server API routes, and internal checkout/Gemini handlers versus their external payment and AI providers.
Main entry points: compress/page.js Tool route pages · merge/page.js Multi-file tools · layout.js Root layout & globals · app/page.js Home page
Components 16
Site & acquisition
- Root layout & globals
app/layout.js - Home page
app/page.js - Shared header
app/components/Header.js - Pricing
app/pricing/page.js - Blog & SEO articles · Includes PDF-task acquisition content.
app/blog/page.js
PDF tool workflows
- Tool route pages · Compression, edit, conversion, OCR, and document-mutation workflows.
app/tools/compress/page.js - Multi-file tools · Merge, organize, and split workflows.
app/tools/merge/page.js
Shared file interaction
- Dropzone
app/components/Dropzone.js - File list
app/components/FileList.js - PDF utilities · Centralizes PDF-oriented transformations.
app/lib/pdf-utils.js
Server integrations
- Checkout handler · Keeps payment integration server-side.
app/api/checkout/route.js - Gemini handler · Keeps AI credentials and provider calls server-side.
app/api/gemini/route.js - Payment provider
- Gemini AI provider
Other components
- Next.js App Router · Browser-based PDF utility application.
- Netlify deployment
netlify.toml
Connections 20
- Next.js App Router → Root layout & globals: renders
- Root layout & globals → Shared header: includes
- Next.js App Router → Home page: serves
- Next.js App Router → Tool route pages: serves
- Next.js App Router → Multi-file tools: serves
- Next.js App Router → Pricing: serves
- Next.js App Router → Blog & SEO articles: serves
- Home page → Tool route pages: drives to
- Blog & SEO articles → Tool route pages: acquires users for
- Tool route pages → Dropzone: accepts files through
- Tool route pages → File list: shows selected files
- Tool route pages → PDF utilities: processes with
- Multi-file tools → Dropzone: accepts files through
- Multi-file tools → File list: manages file sets
- Multi-file tools → PDF utilities: processes with
- Pricing → Checkout handler: starts checkout
- Checkout handler → Payment provider: calls
- Tool route pages → Gemini handler: uses AI operations
- Gemini handler → Gemini AI provider: invokes
- Netlify deployment → Next.js App Router: deploys