Skip to content

Drago-03/Documentation.AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Documentation.AI

Automated Repository Documentation Generator powered by AI

Transform your GitHub repositories into professionally documented projects with the power of AI, advanced NLP, and RAG (Retrieval-Augmented Generation) pipelines.

Documentation.AI Banner

✨ Features

  • πŸ€– AI-Powered Analysis - Advanced AI models analyze your repository structure, dependencies, and architecture
  • πŸ“š Comprehensive Documentation - Generate README files, API docs, setup guides, and more
  • ⚑ Lightning Fast - Process repositories in seconds with optimized RAG pipeline
  • πŸ”’ Secure & Private - Your code is analyzed securely without permanent storage
  • 🧠 Smart Insights - Get architectural insights, complexity analysis, and improvement suggestions
  • 🌍 Multi-Language Support - Python, JavaScript, Java, Go, Rust, and many more
  • 🎨 Beautiful UI - Modern, responsive interface with smooth animations
  • πŸ“Š Analytics Dashboard - Track your documentation generation history

πŸ› οΈ Technology Stack

Backend

  • Python Flask - Web framework for API endpoints
  • Google Gemini AI - Advanced language model for code analysis
  • RAG Pipeline - Retrieval-Augmented Generation with sentence transformers
  • FAISS - Vector similarity search for semantic analysis
  • SQLAlchemy - Database ORM for job tracking
  • GitPython - Git repository manipulation

Frontend

  • React 18 - Modern UI framework with hooks
  • TypeScript - Type-safe JavaScript development
  • TailwindCSS - Utility-first CSS framework
  • Framer Motion - Smooth animations and transitions
  • Lucide React - Beautiful icon set
  • Axios - HTTP client for API communication

AI & ML

  • Sentence Transformers - Text embeddings for semantic search
  • Transformers - Hugging Face model integration
  • NumPy & Pandas - Data processing and analysis
  • LangChain - LLM application framework

πŸ“‹ Prerequisites

  • Python 3.8+ with pip
  • Node.js 14.x+ with npm/yarn
  • Git for repository cloning
  • API Keys (see Configuration section)

πŸ“ Project Structure

Documentation.AI/
β”œβ”€β”€ πŸ“‚ ai_models/          # AI and ML components
β”œβ”€β”€ πŸ“‚ database/           # Database models and configuration
β”œβ”€β”€ πŸ“‚ frontend/           # React frontend application
β”œβ”€β”€ πŸ“‚ scripts/            # Setup and utility scripts
β”œβ”€β”€ πŸ“‚ tests/              # Test suite and testing utilities
β”œβ”€β”€ πŸ“‚ utils/              # Utility functions and helpers
β”œβ”€β”€ πŸ“„ app.py              # Main Flask application
β”œβ”€β”€ πŸ“„ start.sh            # Quick start script (Linux/macOS)
β”œβ”€β”€ πŸ“„ stop.sh             # Stop script (Linux/macOS)
β”œβ”€β”€ πŸ“„ requirements.txt    # Python dependencies
β”œβ”€β”€ πŸ“„ .env.example        # Environment configuration template
└── πŸ“„ README.md           # Project documentation

πŸš€ Quick Start

Simple Setup & Start

Linux/macOS (Recommended)

# Clone the repository
git clone https://github.com/Drago-03/Documentation.AI.git
cd Documentation.AI

# Start the application (handles setup automatically)
./start.sh

Windows

# Clone the repository
git clone https://github.com/Drago-03/Documentation.AI.git
cd Documentation.AI

# Run setup script (one-time)
./scripts/setup.ps1

# Start the application
python app.py

To Stop

# Linux/macOS
./stop.sh

# Windows - Press Ctrl+C in the terminal

Manual Setup (Advanced Users)

1. Backend Setup

# Create and activate virtual environment
python3 -m venv .venv

# Linux/macOS
source .venv/bin/activate

# Windows
.venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

2. Frontend Setup

cd frontend
npm install
npm run build
cd ..

3. Configuration

# Copy environment template
cp .env.example .env

# Edit .env with your API keys (see Configuration section)

4. Start Servers

# Start backend
python app.py

# In another terminal, start frontend (optional - for development)
cd frontend
npm start

βš™οΈ Configuration

Create a .env file with the following configuration:

# AI Model API Keys
GEMINI_API_KEY=your_gemini_api_key_here
NVIDIA_API_KEY=your_nvidia_api_key_here
HUGGINGFACE_TOKEN=your_huggingface_token_here

# GitHub API (optional, for higher rate limits)
GITHUB_TOKEN=your_github_token_here

# Flask Configuration
FLASK_ENV=development
FLASK_DEBUG=True
SECRET_KEY=your_secret_key_here

# Database
DATABASE_URL=sqlite:///documentation_ai.db

# Server Configuration
HOST=0.0.0.0
PORT=5002

Getting API Keys

Google Gemini API Key

  1. Visit Google AI Studio
  2. Sign up or log in with your Google account
  3. Create a new API key
  4. Copy the key to your .env file

Hugging Face Token (Optional)

  1. Visit Hugging Face
  2. Sign up and go to Settings > Access Tokens
  3. Create a new token with read permissions
  4. Add to your .env file

GitHub Token (Optional)

  1. Go to GitHub Settings > Developer settings > Personal access tokens
  2. Generate new token with public_repo scope
  3. Add to your .env file for higher API rate limits

🎯 Usage

Starting the Application

Development Mode

# Terminal 1 - Backend
python app.py

# Terminal 2 - Frontend (for development)
cd frontend
npm start

Production Mode

# Build frontend
cd frontend
npm run build
cd ..

# Start backend (serves built frontend)
python app.py

Visit http://localhost:5002 to access the application.

Using the Web Interface

  1. Home Page - Overview and features
  2. Analyze Page - Enter GitHub repository URL
  3. Results Page - View generated documentation
  4. History Page - Track previous analyses

API Endpoints

Analyze Repository

POST /api/analyze
Content-Type: application/json

{
  "repo_url": "https://github.com/username/repository"
}

Get Job Status

GET /api/job/{job_id}

Get All Jobs

GET /api/jobs

Health Check

GET /api/health

πŸ—οΈ Project Structure

Documentation.AI/
β”œβ”€β”€ app.py                      # Flask application entry point
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ .env.example               # Environment template
β”œβ”€β”€ setup.sh / setup.bat       # Setup scripts
β”œβ”€β”€ README.md                  # This file
β”‚
β”œβ”€β”€ ai_models/                 # AI and ML components
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ github_analyzer.py     # Repository analysis
β”‚   β”œβ”€β”€ documentation_generator.py # Doc generation
β”‚   └── rag_pipeline.py        # RAG implementation
β”‚
β”œβ”€β”€ database/                  # Database models
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── models.py              # SQLAlchemy models
β”‚
β”œβ”€β”€ utils/                     # Utility functions
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── file_processor.py      # File processing utilities
β”‚
└── frontend/                  # React frontend
    β”œβ”€β”€ package.json
    β”œβ”€β”€ tailwind.config.js
    β”œβ”€β”€ public/
    └── src/
        β”œβ”€β”€ components/        # Reusable components
        β”œβ”€β”€ pages/            # Page components
        β”œβ”€β”€ App.tsx           # Main app component
        β”œβ”€β”€ index.tsx         # Entry point
        └── index.css         # Global styles

πŸ§ͺ Testing

Backend Tests

# Run Python tests
python -m pytest tests/

# Run with coverage
python -m pytest tests/ --cov=.

Frontend Tests

cd frontend

# Run React tests
npm test

# Run with coverage
npm run test:coverage

🐳 Docker Deployment

Using Docker Compose

# Build and start services
docker-compose up --build

# Run in background
docker-compose up -d

Manual Docker Build

# Build backend image
docker build -t documentation-ai-backend .

# Build frontend image
cd frontend
docker build -t documentation-ai-frontend .

# Run containers
docker run -p 5002:5002 documentation-ai-backend

πŸš€ Production Deployment

Environment Variables for Production

FLASK_ENV=production
FLASK_DEBUG=False
DATABASE_URL=postgresql://user:pass@host:port/dbname

Using Gunicorn

# Install gunicorn
pip install gunicorn

# Start with gunicorn
gunicorn -w 4 -b 0.0.0.0:5002 app:app

Nginx Configuration

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:5002;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Code Style

  • Python: Follow PEP 8, use Black formatter
  • JavaScript/TypeScript: Follow Airbnb style guide, use Prettier
  • Commit Messages: Use conventional commits format

πŸ“„ License

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

πŸ†˜ Support

πŸ™ Acknowledgments

πŸ“Š Stats

GitHub stars GitHub forks GitHub issues License


Built with ❀️ for developers by developers
Made possible by AI and the open-source community

About

Documentation generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors