Skip to content

Mercure28/TS-DocGen

Repository files navigation

TypeScript Documentation Generator

A powerful tool that automatically generates documentation for your TypeScript code using AI-powered docstring generation and TypeDoc.

Features

  • 🚀 AI-powered docstring generation using OpenAI/Anthropic/Gemini
  • 📝 Automatic TypeScript documentation generation
  • 💻 Modern web interface with Monaco Editor
  • 📁 File upload and processing
  • 📊 Real-time progress tracking
  • 📦 Multiple output formats (HTML/Markdown)
  • 🎨 Customizable documentation templates

Getting Started

Prerequisites

  • Node.js 18+ and npm/yarn
  • OpenAI/Anthropic/Gemini API key (for AI docstring generation)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/ts-docgen.git
cd ts-docgen
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your API keys and configuration
  1. Start the development server:
npm run dev:web
cd ..
cd worker
npm run dev:worker

Usage

  1. Open the web interface at http://localhost:3000
  2. Upload your TypeScript files or paste code directly
  3. Configure documentation settings
  4. Generate documentation
  5. Download or preview the results

API Documentation

Endpoints

POST /api/upload

Upload TypeScript files for documentation generation.

Request Body:

{
  files: File[]
}

GET /api/status/:key

Get the status of a documentation generation job.

Response: Documentation file (HTML/Markdown)

Services

VersioningService

The VersioningService provides version control functionality for documentation files, allowing you to track changes, compare versions, and manage documentation history.

Features

  • Create and manage versions of documentation files
  • Track changes and authors for each version
  • Compare different versions of documentation
  • Tag versions for better organization
  • Retrieve specific versions or the latest version

Configuration

The application can be configured through environment variables:

  • OPENAI_API_KEY: OpenAI API key
  • ANTHROPIC_API_KEY: Anthropic API key
  • GEMINI_API_KEY: Gemini API key
  • SUPABASE_URL: Supabase project URL
  • SUPABASE_SERVICE_ROLE_KEY: Supabase service role key for storage access

Development

Running Tests

npm test

Building for Production

npm run build

Deployment

Production Deployment

  1. Build the application:
npm run build
  1. Start the production server:
npm start

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published