Skip to content

Allmight-456/AutoDocxPdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI-Powered Documentation Generator

Version: 1.2.6 Status: Production Ready License: MIT

Documentation (docx, pdf) generator (using Codebase, Live Site, etc.) from Repomix (context) file, Gemini API key and the Live app URLs. Containerized (Dockerize) for running smoothly (easy setup, configuration) with necessary Env variable info fed into the docker-compose.yml or .env. Also integrates Diagrams (data flow, design flow, etc), Images.

Overview

An autonomous, Docker-based documentation generator that analyzes your codebase and produces professional Word (.docx) and PDF documentation with:

  • AI-Powered Content: Intelligent section generation using Google Gemini 2.5 Flash-Lite
  • Visual Documentation: Automated screenshots of code and live applications
  • Architecture Diagrams: Mermaid diagram generation for system visualization
  • Multiple Formats: Export to DOCX and PDF
  • Zero Configuration: Fully containerized with Docker Compose

Generated Visuals & Examples

Architecture & Design

The tool automatically generates Mermaid diagrams to visualize your project's structure and flow.

Project Overview Project Overview Diagram

Architecture & Design Architecture & Design Diagram

Core Components Core Components Diagram

Automated Screenshots

Captures key parts of your codebase and live application interfaces.

Directory Structure Project Directory Structure

Live API Home Live Application Home Page

Swagger Docs Automated API Documentation Screenshot

Output Examples

Download example documentation generated by this tool:

Key Features

Core Capabilities

  • Multi-Agent Architecture:

    • GeminiDocAgent: AI content generation and planning
    • ScreenshotAgent: Automated code and application screenshots
    • MermaidAgent: Architecture diagram generation
    • DocumentAssembler: Professional document formatting with TOC and hyperlinks
  • Smart Rate Limiting: Configured for Gemini 2.5 Flash-Lite free tier (15 RPM)

  • Comprehensive Documentation: 9-15 sections based on project complexity

  • Live App Screenshots: Capture running application interfaces

  • Cross-Platform PDF Export: LibreOffice-based conversion

Recent Updates (v1.2.6)

  • Table of Contents with automatic numbering
  • Clickable hyperlinks to external resources
  • Contributors and metadata support
  • Improved Mermaid diagram rendering
  • Enhanced ChromeDriver compatibility

Quick Start

Prerequisites

1. Run with Docker Compose (Recommended)

All configuration is in docker-compose.yml - no separate .env file needed:

# 1. Clone the repository
git clone <repo-url>
cd documentation_generator

# 2. Edit docker-compose.yml and set:
#    - GEMINI_API_KEY=your_actual_api_key
#    - PROJECT_PATH=/path/to/your/project (in volumes section)
#    - PROJECT_NAME=Your Project Name
#    - LIVE_APP_URL=http://your-app-url (optional)

# 3. Run the generator
docker-compose up

# 4. Find output in ./output/documentation.docx

The container will:

  • Load configuration from docker-compose.yml
  • Mount your project as read-only at /app/project
  • Generate documentation to ./output/
  • Save screenshots to ./screenshots/
  • Save diagrams to ./mermaid_diagrams/
  • Exit automatically when complete

2. Run Without Docker (Development)

# 1. Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 2. Install dependencies
pip install -r requirements.txt

# 3. Install system dependencies
# Ubuntu/Debian:
sudo apt install chromium chromium-driver libreoffice-writer
npm install -g @mermaid-js/mermaid-cli

# 4. Create .env file (copy from docker-compose.yml environment section)
cp .env.example .env
# Edit .env with your API key and settings

# 5. Run
python run_doc_generator.py

Configuration

Key Settings in docker-compose.yml

environment:
  # API Configuration
  GEMINI_API_KEY: your_api_key_here
  GEMINI_MODEL: gemini-2.5-flash-lite  # Free tier: 15 RPM, 1000 req/day

  # Project Configuration
  PROJECT_NAME: "Your Project Name"
  PROJECT_PATH: /app/project  # Mapped from volumes
  PROJECT_DESCRIPTION: "Brief description"

  # Rate Limiting (optimized for free tier)
  GEMINI_REQUEST_DELAY: 5  # 5s = 12 req/min (under 15 RPM limit)
  GEMINI_MAX_REQUESTS_PER_MINUTE: 15

  # Screenshot Configuration
  ENABLE_SCREENSHOTS: true
  BROWSER_CHOICE: chrome  # Uses Chromium in Docker
  MAX_SCREENSHOTS_PER_DOCUMENT: 8

  # Diagram Configuration
  ENABLE_MERMAID_DIAGRAMS: true
  MAX_MERMAID_DIAGRAMS: 3

  # PDF Export
  ENABLE_PDF_EXPORT: true

  # Optional: Repomix for better context
  USE_REPOMIX: true
  REPOMIX_FILE_PATH: /app/project/repomix-output.xml

Why Gemini 2.5 Flash-Lite?

This model is chosen specifically for the free tier limits:

  • Rate Limits: 15 requests per minute (RPM)
  • Daily Limit: 1,000 requests per day
  • Throughput: 250K tokens/minute

With GEMINI_REQUEST_DELAY=5 seconds:

  • 12 requests/minute (80% utilization)
  • Safely stays under the 15 RPM limit
  • Prevents rate limit errors

Architecture

Agent System

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  DocumentationGenerator     β”‚
β”‚   (Main Orchestrator)       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
     β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚           β”‚             β”‚
     v           v             v
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Gemini   β”‚ β”‚Screenshotβ”‚ β”‚ Mermaid  β”‚
β”‚DocAgent  β”‚ β”‚  Agent   β”‚ β”‚  Agent   β”‚
β”‚(Content) β”‚ β”‚(Selenium)β”‚ β”‚(Diagrams)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                  β”‚             β”‚
                  v             v
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚Chromium β”‚   β”‚Puppeteerβ”‚
             β”‚ Browser β”‚   β”‚ (mmdc)  β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚             β”‚
                  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                         v
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚  Document   β”‚
                  β”‚  Assembler  β”‚
                  β”‚ (DOCX+PDF)  β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

documentation_generator/
β”œβ”€β”€ doc_generator.py           # Main generator with all agents
β”œβ”€β”€ run_doc_generator.py       # Wrapper script with validation
β”œβ”€β”€ requirements.txt           # Python dependencies
β”œβ”€β”€ Dockerfile                 # Container image definition
β”œβ”€β”€ docker-compose.yml         # Complete configuration
β”œβ”€β”€ docker-entrypoint.sh       # Container initialization
β”‚
β”œβ”€β”€ output/                    # Generated documentation
β”œβ”€β”€ screenshots/               # Captured screenshots
β”œβ”€β”€ mermaid_diagrams/          # Generated diagrams
β”‚
└── Documentation:
    β”œβ”€β”€ README.md              # This file
    β”œβ”€β”€ IMPLEMENTATION_STATUS.md  # Feature status
    β”œβ”€β”€ FEATURES_v1.2.5.md     # Latest features
    β”œβ”€β”€ BUILD.md               # Build instructions
    β”œβ”€β”€ DOCKER_SETUP.md        # Docker details
    └── CHANGELOG.md           # Version history

Repomix Integration

For best results, generate a repomix file before running:

# Install repomix (if not already installed)
npm install -g repomix

# Generate context file
repomix /path/to/your/project -o repomix-output.xml

# Place in project root or specify path in docker-compose.yml

Benefits:

  • Better AI understanding of codebase
  • Faster context loading
  • Respects .gitignore automatically

Set in docker-compose.yml:

USE_REPOMIX: true
REPOMIX_FILE_PATH: /app/project/repomix-output.xml

Troubleshooting

See DOCKER_SETUP.md for detailed troubleshooting or check docker-compose logs.

Contributing

See CONTRIBUTING.md for code style guidelines and development workflow.

License

MIT License - see LICENSE file

About

Documentation( docx, pdf) generator (using Codebase, Live Site, etc.) from Repomix (context ) file, Gemini API key and the Live app URLs. Containerized (Dockerize) for running smoothly (easy setup, configuration) with necessary Env variable info fed into the docker-compose.yml or .env . Also integrates Diagrams( data flow, design flow, etc), Images

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors