Skip to content

prithwiraj84/AI-Humanizer-Pro

Repository files navigation

divider

✨ Overview

AI Humanizer Pro rewrites robotic, AI-generated text into natural writing that reads like a real person β€” and slips past AI detectors. It ships as a decoupled full-stack app:

  • ⚑ FastAPI ASGI backend (API-only) β€” auth, API keys, usage analytics, OTP reset, admin console API, and the NLTK-powered humanizer.
  • 🎨 Next.js 14 + Three.js frontend β€” an SEO-optimized, scroll-driven 3D landing page plus the humanizer tool, dashboard, docs, and a full admin console.
tech stack

divider

πŸš€ Features

Feature Description
πŸͺ„ Deep humanization Restructures phrasing, perplexity & rhythm so output reads human, not machine
πŸ›‘οΈ Detector-resistant Lowers AI-probability scores while preserving your meaning
🎚️ Tone control Standard · Professional · Casual · Academic voices
⚑ Instant results Async, non-blocking backend with a live before/after diff
πŸ”‘ Developer API Generate keys and humanize via a single REST endpoint
πŸ“Š Usage analytics Per-user request, latency & success-rate dashboard
πŸ§‘β€πŸ’Ό Admin console Users, API keys & a full activity log
🌌 3D landing page Scroll-driven Three.js scene + Framer Motion reveals
πŸ” SEO-first Metadata, OpenGraph, JSON-LD, sitemap & robots

divider

πŸ—οΈ Architecture

flowchart LR
    U([πŸ§‘ Browser]) -->|pages| N["β–² Next.js 14<br/>App Router"]
    N -->|backend proxy| F["⚑ FastAPI<br/>ASGI · Uvicorn"]
    N -.->|WebGL| T["🌌 Three.js<br/>scroll scene"]
    F --> DB[("πŸ—„οΈ SQLite<br/>WAL")]
    F --> M["πŸ“§ SMTP<br/>OTP email"]
    F --> NL["πŸ“š NLTK<br/>WordNet"]

    classDef front fill:#6366f1,stroke:#fff,color:#fff;
    classDef back fill:#009688,stroke:#fff,color:#fff;
    classDef store fill:#a855f7,stroke:#fff,color:#fff;
    class N,T front;
    class F,M,NL back;
    class DB store;
Loading

The Next.js dev server proxies every /backend/* request to FastAPI, keeping the session cookie same-origin (no CORS, no SameSite gymnastics).

divider

πŸ“‚ Project structure

ai-humanizer-pro/
β”œβ”€β”€ app.py                 # FastAPI API (auth, keys, usage, admin, humanizer)
β”œβ”€β”€ gunicorn.conf.py       # Uvicorn worker config for production
β”œβ”€β”€ requirements.txt       # Python deps
β”œβ”€β”€ humanizer.db           # SQLite (gitignored)
└── frontend/              # Next.js 14 + Three.js
    β”œβ”€β”€ next.config.js     # /backend/* β†’ FastAPI proxy
    β”œβ”€β”€ tailwind.config.js
    └── src/
        β”œβ”€β”€ app/           # routes: /, /humanizer, /dashboard, /docs, /admin …
        β”œβ”€β”€ components/    # three/, landing/, admin/, auth/, ui/, layout/
        β”œβ”€β”€ context/       # AuthContext
        └── lib/           # api client, site config

divider

βš™οΈ Quick start

Prerequisites: Python 3.11+ and Node.js 18+ (tested on 22).

1️⃣ Backend (FastAPI)

python -m venv .venv
# Windows: .venv\Scripts\activate   |   macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
python app.py                       # β†’ http://127.0.0.1:5001

2️⃣ Frontend (Next.js)

cd frontend
npm install
npm run dev                         # β†’ http://localhost:3000

Open http://localhost:3000 πŸŽ‰

divider

πŸ” Environment variables

Backend

Variable Default Purpose
SECRET_KEY random per start Signs the session cookie β€” set in prod
ADMIN_EMAIL admin@aih.local Admin console login
ADMIN_PASSWORD ChangeAdminPassword123! Change in prod
SENDER_EMAIL β€” SMTP sender for OTP email
SENDER_PASSWORD β€” SMTP app password
SMTP_SERVER / SMTP_PORT smtp.gmail.com / 587 Mail server
PORT / WEB_CONCURRENCY 10000 / 1 Set by host (Render)

Frontend

Variable Default Purpose
BACKEND_URL http://127.0.0.1:5001 Proxy target for /backend/*
NEXT_PUBLIC_SITE_URL http://localhost:3000 Canonical URL for SEO

divider

🧩 API reference

POST /humanize β€” authenticate with a session cookie or an X-API-Key header.

πŸ“¦ Request
{
  "text": "Your AI generated text here",
  "tone": "professional",
  "deep_mode": true
}
πŸ§ͺ Examples
curl -X POST https://noai.devprithwiraj.in/humanize \
  -H "Content-Type: application/json" \
  -H "X-API-Key: hmnz_your_api_key_here" \
  -d '{"text":"...","tone":"professional","deep_mode":true}'
const res = await fetch("https://noai.devprithwiraj.in/humanize", {
  method: "POST",
  headers: { "Content-Type": "application/json", "X-API-Key": "hmnz_..." },
  body: JSON.stringify({ text: "...", tone: "professional", deep_mode: true }),
});
const data = await res.json();
console.log(data.humanized);
sequenceDiagram
    participant C as Client
    participant F as FastAPI
    participant N as NLTK
    C->>F: POST /humanize (X-API-Key)
    F->>F: verify key / session
    F->>N: rephrase + perplexity spike
    N-->>F: humanized text
    F->>F: diff metrics + log usage
    F-->>C: { humanized, ai_probability, diff_html, ... }
Loading

divider

πŸ—ΊοΈ Pages

Route Description SEO
/ 3D scroll landing page βœ…
/humanizer The humanizer tool πŸ”’
/dashboard Usage + API keys πŸ”’
/docs API documentation βœ…
/login Β· /signup Β· /forgot-password Auth + OTP reset πŸ”’
/admin Β· /admin/login Admin console πŸ”’

divider

☁️ Deployment

One service β€” website + API on a single URL (Docker):

  • Render β†’ New + β†’ Blueprint (uses render.yaml + Dockerfile), or set the service's Runtime = Docker (./Dockerfile).
  • The image builds the Next.js static export and serves it with FastAPI β€” no separate frontend host.
  • Set ADMIN_EMAIL, ADMIN_PASSWORD, SENDER_EMAIL, SENDER_PASSWORD in the dashboard (SECRET_KEY is auto-generated). Health check: /healthz.

πŸ”΄ Note: SQLite on ephemeral hosts resets on redeploy β€” use managed Postgres or a persistent disk for durable data.

divider

🧭 Roadmap

  • FastAPI API-only backend
  • Next.js + Three.js frontend
  • Admin console in Next.js
  • SEO (metadata, JSON-LD, sitemap)
  • Migrate SQLite β†’ Postgres
  • Rate limiting & quotas
  • Stripe billing tiers

divider

πŸ‘€ Author

Prithwiraj 🌐 noai.devprithwiraj.in

⭐ If this project helped you, give it a star! ⭐

footer

About

The AI Text Humanizer is designed to take AI-generated content and transform it into text that appears more naturally human-written. It uses four distinct transformation techniques working in tandem to modify text structure, vocabulary, and encoding without compromising comprehensibility.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors