Skip to content

Repository files navigation

DocGenius Banner

🌐 Live Demo  ·  🤖 AI Studio


DocGenius — AI Document Assistant

DocGenius is a smart, 4-step AI-powered document generation tool. From a simple topic idea, it helps you generate structured outlines, detailed chapter plans, and polished full-text drafts — all with AI assistance at every stage.


✨ Features

  • 🧠 AI-Powered Outlining — Enter a topic and optional writing style; AI generates 3 distinct outlines with chapter structures. Supports diverse tones (Academic, Professional, Creative, etc.).

  • 📝 Smart Chapter Breakdown — Each chapter gets a detailed bullet-point plan generated by AI, covering sub-topics, arguments, and data points to include.

  • ✍️ One-Click Chapter Drafting — AI writes full, coherent content for every chapter based on the detailed plan. Supports Markdown formatting and optional chart/image analysis for data-driven sections.

  • 🔧 Multi-Provider Support — Defaults to Google Gemini (2.5 Flash / Pro) with built-in support for any OpenAI-compatible API (Moonshot, DeepSeek, custom endpoints, etc.).

  • 📤 Export & Refine — Review the final document in-app, refine content with custom rewrite instructions, and export your finished work.

  • 📱 PWA Ready — Installable as a standalone app with offline support.


🏗️ Tech Stack

Layer Technology
Framework React 19 + TypeScript
Build Tool Vite 6
Styling Tailwind CSS (via CDN)
AI SDK @google/genai (Google Gemini)
Alternate AI OpenAI-compatible REST API
PWA Service Worker + Web Manifest

📁 Project Structure

TextGen/
├── App.tsx                     # Root component & global state
├── index.tsx                   # Entry point
├── index.html                  # HTML shell with Tailwind CDN
├── types.ts                    # TypeScript type definitions & enums
├── vite.config.ts              # Vite configuration
├── manifest.json               # PWA manifest
├── sw.js                       # Service Worker
├── components/
│   ├── Step1_Topic.tsx         # Step 1: Topic input & outline selection
│   ├── Step2_Details.tsx        # Step 2: Chapter detail planning
│   ├── Step3_Drafting.tsx       # Step 3: AI content generation
│   ├── Step4_Export.tsx         # Step 4: Review, refine & export
│   ├── StepIndicator.tsx        # Progress step indicator
│   └── SettingsModal.tsx        # AI provider & model configuration
└── services/
    └── geminiService.ts         # AI call abstraction (Gemini SDK + OpenAI fetch)

🚀 Getting Started

Prerequisites

  • Node.js >= 18
  • A Gemini API Key from Google AI Studio (or an OpenAI-compatible endpoint)

Installation

# Clone the repository
git clone https://github.com/pengcong2020520/TextGen.git
cd TextGen

# Install dependencies
npm install

Configuration

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

GEMINI_API_KEY=your_gemini_api_key_here

You can also switch to a custom AI provider at runtime via the Settings panel in the app — no additional configuration required.

Run Locally

npm run dev

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

Build for Production

npm run build
npm run preview    # Preview the production build

🔄 How It Works

Step 1                  Step 2                 Step 3                 Step 4
┌──────────────┐       ┌──────────────┐       ┌──────────────┐       ┌──────────────┐
│  Topic &     │  →    │  Chapter     │  →    │  AI          │  →    │  Review &    │
│  Outline     │       │  Details     │       │  Drafting    │       │  Export      │
│              │       │              │       │              │       │              │
│ • Enter topic│       │ • AI fills   │       │ • AI writes  │       │ • Refine     │
│ • Pick style │       │   bullet     │       │   full text  │       │ • Copy/export│
│ • AI generates│      │   points per │       │   per chapter│       │ • Start over │
│   3 outlines │       │   chapter    │       │ • Chart      │       │              │
│ • Edit as    │       │ • Edit as    │       │   analysis   │       │              │
│   needed     │       │   needed     │       │   support    │       │              │
└──────────────┘       └──────────────┘       └──────────────┘       └──────────────┘

🌐 Deployment

The app is deployed on Vercel at text-gen-theta.vercel.app. To deploy your own instance:

Deploy with Vercel


📄 License

This project is open source and available under the MIT License.


Made with ❤️ by @pengcong2020520

About

AI-powered document generation tool with 4-step workflow — outline, detail, draft, and export. Built with React, TypeScript, and Google Gemini.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages