Skip to content

Repository files navigation

📄 WisePDF — AI Document Intelligence & Modern PDF Tools

Transform PDFs into smart interactive flashcards, AI summaries, and edit documents with sub-pixel precision. Built with Next.js 15, Google Gemini AI, LangChain, Neon PostgreSQL, Clerk, and Stripe.

Live Demo Next.js React TypeScript Tailwind CSS PostgreSQL


🌟 Overview

WisePDF is an all-in-one AI-driven document platform designed for students, researchers, and professionals. It bridges the gap between passive reading and active recall by converting long, unstructured PDFs into interactive flashcards and concise executive summaries, paired with a complete cloud-based PDF editing and conversion toolkit.


🚀 Key Features

🧠 AI Document Intelligence & Flashcards

  • PDF-to-Flashcards: Ingests dense academic papers, syllabi, and textbooks, generating structured Q&A cards optimized for spaced-repetition learning.
  • Context-Aware Summaries: Produces structured bullet-point takeaways and executive briefings powered by Google Gemini and LangChain.
  • AI Document Generator: Prompt-based document drafting with automatic formatting, exportable directly to PDF or Word DOCX.
  • Smart Rewrite-to-Fit: Automatically rewrites sentences using LLMs to fit within specific visual character boundaries on a page.

✍️ In-Place Visual PDF Text Editor

  • WYSIWYG Text Editing: Select and edit existing text directly on the rendered document canvas.
  • Full Typography Control: Customize font family (Helvetica, Times New Roman, Georgia, Garamond, Courier, Verdana, Trebuchet), font size, weight, italic, and color presets.
  • Keyboard & UI Point-Level Nudging:
    • Fine-tune replacement text coordinates using keyboard arrow keys (↑ ↓ ← →).
    • Hold Shift for coarse adjustments (5.0pt) or Alt for micro-precision (0.2pt).
    • Interactive on-canvas and toolbar directional buttons with instant live coordinate readouts (dx, dy) and reset triggers.

🛠️ Comprehensive PDF Utility Suite

  • Merge & Split: Combine multiple documents or extract custom page ranges and individual pages.
  • Rotate & Reorder: Reorganize document flow with interactive drag-and-drop page sorting (@dnd-kit).
  • Watermark & Page Numbers: Add dynamic diagonal/centered watermarks, customizable opacity, and automatic page numbers (Page X of Y).
  • Headers & Footers: Stamp custom document classifications, titles, and dates.
  • Security & Privacy: Password-protect sensitive PDFs with 256-bit encryption or unlock protected files.
  • Ghostscript Compression: Reduce large files by up to 80% with customizable compression profiles (Extreme, Recommended, High Quality).
  • Format Conversions: Seamless bi-directional conversions between Microsoft Office (.docx, .xlsx, .pptx) and PDF.

⚡ Secure Sharing & Developer Ecosystem

  • Cloud & P2P File Sharing: Share documents securely via cloud storage or direct WebRTC peer-to-peer data channels.
  • Developer Tracker: Integrated analytics tracking GitHub commit activity, contribution streaks, and LeetCode problem progression.
  • Tiered Subscriptions & Entitlements: Built-in billing infrastructure with Stripe webhooks, usage quotas, and Clerk authentication.

🏗️ Architecture & Tech Stack

Layer Technology Purpose
Framework Next.js 15 (App Router) + React 19 Core application structure, server actions, and route handlers
Language TypeScript Type-safe enterprise architecture across all actions and components
Styling & UI Tailwind CSS v4 + Motion + Lucide Sleek dark-mode aesthetic with glassmorphic cards and micro-animations
AI Orchestration LangChain + Google Gemini API Document understanding, OCR vision analysis, and text summarization
Database Neon (Serverless PostgreSQL) Persistent storage for users, summaries, flashcards, and quotas
Authentication Clerk Secure user management, social authentication, and route guards
Payments Stripe Subscription checkouts, customer portal, and webhook handling
File Storage UploadThing Cloud storage pipeline for document uploads
Clientside PDF Mozilla PDF.js Viewport rendering and character bounding box overlays
Compute Microservice Docker + Node.js + LibreOffice + Ghostscript High-compute microservice for conversions, compression, and vector text editing

🚦 Getting Started

1. Prerequisites

  • Node.js 20+ installed
  • npm, pnpm, or yarn

2. Clone the Repository

git clone https://github.com/RadicalThinker/summatrix.git
cd summatrix/summatrix-web

3. Install Dependencies

npm install

4. Configure Environment Variables

Create a .env.local file in the summatrix-web directory:

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/safe/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/safe/dashboard

# Database (Neon Serverless PostgreSQL)
DATABASE_URL=postgresql://user:password@ep-xyz.neon.tech/neondb?sslmode=require

# Google Gemini AI
GEMINI_API_KEY=your_gemini_api_key

# Stripe Billing
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...

# UploadThing Storage
UPLOADTHING_SECRET=sk_live_...
UPLOADTHING_APP_ID=...

# PDF Processing Microservice Endpoint
NEXT_PUBLIC_PDF_API_URL=https://129.154.251.76.nip.io

# Optional: GitHub Dev Tracker
GITHUB_TOKEN=your_github_personal_access_token

5. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.


📦 Scripts

Command Description
npm run dev Starts Next.js development server with Turbopack
npm run build Compiles an optimized production build
npm run start Runs the production build locally
npm run lint Runs ESLint to check code quality

🌐 Deployment

This web application is optimized for deployment on Vercel:

  1. Push your repository to GitHub.
  2. Import the project into your Vercel Dashboard.
  3. Set the Root Directory to summatrix-web (if in a monorepo).
  4. Add all environment variables from .env.local.
  5. Click Deploy.

📄 License

This project is licensed under the MIT License.

About

WisePDF — AI-powered PDF-to-flashcard learning platform & full-featured cloud document studio. In-place vector text editing, format conversions, compression, and smart summarization built with Next.js 15, Gemini AI, LangChain, and Stripe.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages