Skip to content

vadchil/theparafraser

Repository files navigation

TheParafrase

🔥 AI-powered paraphrasing tool supporting multiple languages and writing styles.

Next.js TypeScript Tailwind CSS License: MIT

✨ Features

  • Multi-language Paraphrasing — Auto-detect input language, output in 8+ languages
  • Tone Control — Formal, Casual, Academic, Short & Concise, or Translate-only mode
  • Multiple AI Models — Choose between Gemini 3 Flash, Gemini 1.5 Flash, or GPT-OSS 120B
  • Multiple Variants — Generate 1–3 variations simultaneously
  • Diff Highlighting — Word-by-word change visualization (added/removed)
  • Readability Stats — Flesch score, grade level, reading time, word/char counts
  • History — Auto-saved paraphrase history (localStorage, max 20 entries)
  • Daily Limit — Free tier with 10 requests/day + donation CTA
  • Dark Mode UI — Premium glassmorphism design with smooth animations

🚀 Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/yourusername/theparafrase.git
cd theparafrase

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local
# Edit .env.local and add your API keys

Environment Variables

Create a .env.local file in the project root:

GEMINI_API_KEY=your_gemini_api_key_here
OPENROUTER_API_KEY=your_openrouter_api_key_here  # Optional, for GPT-OSS model

Development

npm run dev

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

Production Build

npm run build
npm run start

🏗️ Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript 5
Styling Tailwind CSS 4
UI Components shadcn/ui (base-ui)
AI Provider Google Gemini API / OpenRouter
Deployment Vercel

📁 Project Structure

src/
├── app/
│   ├── api/paraphrase/   # API route handler
│   ├── globals.css        # Design system & animations
│   ├── layout.tsx         # Root layout with SEO metadata
│   └── page.tsx           # Main application page
├── components/
│   ├── ui/                # shadcn/ui components
│   ├── DiffViewer.tsx     # Word diff visualization
│   ├── HistoryPanel.tsx   # History drawer panel
│   ├── LimitModal.tsx     # Daily limit CTA modal
│   └── ReadabilityStats.tsx # Text metrics display
└── lib/
    ├── readability.ts     # Flesch score calculator
    ├── useDailyLimit.ts   # Daily usage tracking hook
    ├── useHistory.ts      # History persistence hook
    └── utils.ts           # Utility functions

🔒 Security

  • API keys are server-side only (never exposed to the client)
  • Input validation & sanitization on API routes
  • Rate limiting via daily request caps
  • Security headers configured via next.config.ts
  • Input length capped at 2000 words

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.

☕ Support

If you find this tool useful, consider supporting the development:

Buy Me A Coffee

About

AI-powered paraphrasing tool supporting multiple languages and writing styles.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors