βββββββ ββββββ βββββββ ββββββ βββββββββββ βββββββ βββ βββ βββββββββββββββββββββββββββββββββββββββββββ ββββββββββββ βββ ββββββββββββββββββββββββββββββββββββββ βββ βββ ββββββ ββ βββ βββββββ ββββββββββββββββββββββββββββββ βββ βββ βββββββββββββ βββ βββ ββββββ ββββββ ββββββ βββββββββββββββββββββββββββ βββ βββ ββββββ ββββββ ββββββ ββββββββ βββββββ ββββββββ
βοΈ ParaFlow AI β Writing Intelligence Platform Seven engines, one writing assistant.
ParaFlow AI is a full-stack writing-intelligence SaaS: a Next.js frontend, a FastAPI backend, and seven prompt-engineered/rule-based AI writing tools (paraphrase, humanize, detect, grammar, summarize, translate, SEO) processed synchronously per-request through a single Gemini-backed LLM service, with Supabase for auth/persistence and Stripe for billing. (Celery/Redis are configured in the repo but not currently wired into any live endpoint β see the architecture notes below.)
Most writing tools do one thing. ParaFlow AI bundles the full workflow β rewrite it, humanize it, check if it reads as AI-written, fix the grammar, summarize it, translate it, optimize it for SEO β behind one API, with a per-user "Writing DNA" style profile and a multi-agent "Agent Studio" that iteratively revises text until it hits a target quality score.
Client Layer
ββββββββββββββββββββββ
β Next.js 15 Web β
β (React 19 / TS) β
ββββββββββββ¬ββββββββββ
βΌ
ββββββββββββββββββββββ
β Cloudflare CDN / β Security & delivery
β WAF β
ββββββββββββ¬ββββββββββ
βΌ
ββββββββββββββββββββββ
β FastAPI /api/v1 β API gateway + routing
ββββββββββββ¬ββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend Endpoints β
β auth Β· users Β· billing Β· health Β· tools Β· β
β writing_dna Β· agents β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Orchestration β
β llm_service.generate_dict() β
β β provider factory β GeminiProvider β
β (called synchronously, in-request β see note) β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Engines (7) β
β Paraphrase Β· Humanize Β· Detect Β· Grammar Β· β
β Summarize Β· Translate Β· SEO β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββ
β Supabase (client β real path: credits, users,
β library, not ORM) β writing_dna_profiles, etc.
ββββββββββββββββββββββ
Note on the whiteboard version: the original hand-drawn diagram sketches a Mobile/Web/Desktop client layer, a "Gen AI Voice" engine, a separate Vector DB, and a "Mem0" memory feeding a "DNA Engine." In the current codebase: only the Next.js web client is implemented; there's no voice/audio engine; and there's no separate vector database or Mem0 β the closest thing to the "DNA Engine" is Writing DNA (see below).
Note on the Celery/Redis queue:
docker-compose.ymlruns a Redis container and acelery_workerservice, andworkers/celery_app.pydefinesparaphrase_task,humanize_task,detect_task, andagent_studio_task. However, nothing in the live API code calls.delay()or.apply_async()on any of these tasks β every/toolsendpoint (tools.py) runs its engine directly and synchronously inside the request handler and returns the result immediately. The Celery tasks would also currently fail if invoked: they importasync_session_makerfromapp.db.database, but that module only defines a stubget_db()that yieldsNoneand a no-opinit_db()β there is no real SQLAlchemy engine or session factory wired up anywhere in the codebase, despitesqlalchemy[asyncio]andasyncpgbeing inrequirements.txt. The actual, working persistence path for users/credits/writing-DNA is the Supabase Python client (db/supabase.py), called directly from the services.
- Next.js 15 (App Router) + React 19 + TypeScript
- Tailwind CSS 4 + shadcn/ui (built on Radix primitives)
- Zustand for local state, TanStack Query v5 for server state
- Supabase JS/SSR client for auth
- React Hook Form + Zod for forms/validation, Framer Motion for animation, Recharts for charts
- Feature panels:
SummarizerPanel,TranslatorPanel,WritingDNAPanel, etc.
- FastAPI + Pydantic 2 + pydantic-settings
- python-jose + passlib[bcrypt] for JWT access/refresh-token auth
- Real persistence goes through the Supabase Python client
(
db/supabase.py) βsqlalchemy[asyncio]/asyncpgare inrequirements.txtbut the app's actual DB dependency (db/database.py) is a stub, so no ORM session is wired up in this snapshot - Celery 5.4 + Redis are configured (see architecture note above) but no live endpoint currently enqueues a task
- structlog for structured logging, httpx for outbound calls
llm_service.pyβ single provider-agnostic entry point for LLM-backed enginesproviders/factory.pyβ provider abstraction; Gemini is currently the only active provider (gemini-2.5-flashby default), with automatic fallback-chain plumbing in place for future providers- Not every engine calls the LLM β see the table below. The ones that do build their own system/user prompt; there's no fine-tuning anywhere
| Engine | File | How it works |
|---|---|---|
| Paraphrase | paraphrase_engine.py |
Gemini (prompt-engineered rewrite by mode/strength) |
| Humanize | humanize_engine.py |
Gemini (rewrite toward a target AI-detection pass rate) |
| Grammar | grammar_engine.py |
Gemini (grammar/style correction) |
| Summarize | summarize_engine.py |
Gemini (condense text) |
| Translate | translate_engine.py |
Gemini (language translation) |
| Detect | detect_engine.py |
Rule-based, no LLM call β weighted heuristic score from sentence-length uniformity ("perplexity"), variance ("burstiness"), and AI-phrase pattern matching |
| SEO | seo_engine.py |
Rule-based, no LLM call β keyword density, readability, and title-quality heuristics |
Builds a per-user style profile from writing samples. Two versions of this
schema exist in the repo and disagree with each other: the Pydantic model
in models/models.py defines style_embedding, vocabulary_richness,
formality_score, burstiness_score, rhythm_score, structure_score,
etc., while the actual writing_dna_profiles table in
supabase_migration.sql has profile_data JSONB, dominant_style,
tone_analysis JSONB, vocabulary_score, sentence_variation_score, and
readability_score β no style_embedding column at all. Whichever code path
runs against the live Supabase table would need to use the SQL migration's
column names.
Runs a multi-agent revision loop over up to 5 named agents (grammar, seo,
humanizer, tone, fact_checker), iterating until a target health score is
hit or max_iterations is reached. In the current code, grammar calls
GrammarEngine, seo calls SEOEngine, and humanizer calls
HumanizeEngine β tone and fact_checker are no-op stubs that report
success without changing the text. Scoring between iterations also comes
from HealthScoreService.calculate_score() fed with hardcoded inputs rather
than a live re-analysis of the text.
A weighted composite score (grammar 25% Β· readability 20% Β· originality 20% Β·
human-likeness 20% Β· SEO 10% Β· tone 5%) exposed via /api/v1/health/score and
/api/v1/health/evolution/{job_id}. Note: this is distinct from the
plain /api/health liveness check in main.py, and in the current code both
health/score and health/evolution return illustrative/hardcoded values
rather than a live computation β consistent with DEMO_MODE=True in
core/config.py, which also lets auth, billing, and writing_dna run
without a live Supabase connection for local dev/demos.
- Stripe integration (
billing_service.py), real reads/writes go through the Supabase client against thecreditstable - Tier naming is inconsistent across the codebase: the Pydantic
SubscriptionTierenum (models/models.py) says Free / Pro / Team, but thesubscriptions.planandusers.rolecheck constraints insupabase_migration.sqlonly allow free / pro / enterprise ToolJob(queued β processing β completed/failed) exists as a Pydantic model and atool_jobstable, but the live/toolsendpoints don't create or update these rows β they generate a freshjob_idper response and return the result directly without persisting a job record
Tables (per supabase_migration.sql): users, credits, tool_jobs,
writing_dna_profiles, subscriptions, api_keys β one relational Postgres
instance behind Supabase, accessed via the Supabase client library rather
than SQLAlchemy. No separate vector database.
cd backend
python -m venv venv
source venv/bin/activate # venv\Scripts\activate on Windows
pip install -r requirements.txt
uvicorn app.main:app --reloadcd frontend
npm install
npm run devdocker-compose up --buildSpins up Postgres, Redis, the FastAPI backend, and a celery_worker service
β note the worker currently has no task producer feeding it (see the
architecture note above), so it will sit idle even when running.
Copy .env.example β .env in both backend/ and frontend/ and set at
minimum: SUPABASE_URL, SUPABASE_KEY, SUPABASE_SERVICE_KEY,
GEMINI_API_KEY, plus CELERY_BROKER_URL / CELERY_RESULT_BACKEND (Redis).
Paraflow-AI-main/
β
βββ frontend/ β Next.js 15 app
β βββ src/
β βββ components/features/ β SummarizerPanel, TranslatorPanel, WritingDNAPanel...
β βββ components/ui/ β shadcn/ui components
β βββ providers/, stores/, hooks/, lib/
β
βββ backend/
β βββ app/
β βββ ai/
β β βββ llm_service.py
β β βββ providers/ β factory.py, base.py, gemini.py
β β βββ engines/ β paraphrase, humanize, detect, grammar,
β β summarize, translate, seo
β βββ services/ β tool, writing_dna, billing,
β β health_score, agent_studio, user
β βββ api/v1/endpoints/ β auth, users, billing, health, tools,
β β writing_dna, agents
β βββ models/, schemas/, db/, workers/, core/
β
βββ scripts/ β test_all_endpoints.py, test_nvidia.py
βββ tests/
βββ docker-compose.yml
βββ supabase_migration.sql
Backend (backend/requirements.txt)
fastapi>=0.115.0
uvicorn[standard]>=0.30.0
pydantic>=2.9.0
pydantic-settings>=2.5.0
sqlalchemy[asyncio]>=2.0.0
asyncpg>=0.29.0
python-jose[cryptography]>=3.3.0
passlib[bcrypt]>=1.7.4
httpx>=0.27.0
celery[redis]>=5.4.0
structlog>=24.4.0
supabase>=2.31.0
(sqlalchemy[asyncio]/asyncpg are listed but there's no wired-up engine or
session factory in this snapshot β see the architecture notes above.
anthropic and openai are also listed but currently unused β Gemini is the
only wired-up LLM provider.)
Frontend (frontend/package.json)
next@15.5
react@19
typescript@5.6
tailwindcss@4
zustand@5
@tanstack/react-query@5
@supabase/supabase-js
framer-motion
recharts
react-hook-form + zod
@misc{paraflowai2026,
title = {ParaFlow AI: A Full-Stack Writing Intelligence Platform},
author = {Mantasha},
year = {2026},
url = {https://github.com/itimantasha/Paraflow-AI},
note = {B.Tech Portfolio Project}
}
Built with βοΈ by Mantasha & Team
B.Tech Β· Full-Stack & AI Engineering
β Star this repo if you found it useful