|
| 1 | +# TypeScript Documentation Generator |
| 2 | + |
| 3 | +A powerful tool that automatically generates documentation for your TypeScript code using AI-powered docstring generation and TypeDoc. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🚀 AI-powered docstring generation using OpenAI/Anthropic/Gemini |
| 8 | +- 📝 Automatic TypeScript documentation generation |
| 9 | +- 💻 Modern web interface with Monaco Editor |
| 10 | +- 📁 File upload and processing |
| 11 | +- 📊 Real-time progress tracking |
| 12 | +- 📦 Multiple output formats (HTML/Markdown) |
| 13 | +- 🎨 Customizable documentation templates |
| 14 | + |
| 15 | +## Getting Started |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +- Node.js 18+ and npm/yarn |
| 20 | +- OpenAI/Anthropic/Gemini API key (for AI docstring generation) |
| 21 | + |
| 22 | +### Installation |
| 23 | + |
| 24 | +1. Clone the repository: |
| 25 | +```bash |
| 26 | +git clone https://github.com/yourusername/ts-docgen.git |
| 27 | +cd ts-docgen |
| 28 | +``` |
| 29 | + |
| 30 | +2. Install dependencies: |
| 31 | +```bash |
| 32 | +npm install |
| 33 | +``` |
| 34 | + |
| 35 | +3. Set up environment variables: |
| 36 | +```bash |
| 37 | +cp .env.example .env |
| 38 | +# Edit .env with your API keys and configuration |
| 39 | +``` |
| 40 | + |
| 41 | +4. Start the development server: |
| 42 | +```bash |
| 43 | +npm run dev:web |
| 44 | +``` |
| 45 | + |
| 46 | +```bash |
| 47 | +cd .. |
| 48 | +``` |
| 49 | +```bash |
| 50 | +cd worker |
| 51 | +``` |
| 52 | +```bash |
| 53 | +npm run dev:worker |
| 54 | +``` |
| 55 | + |
| 56 | +## Usage |
| 57 | + |
| 58 | +1. Open the web interface at `http://localhost:3000` |
| 59 | +2. Upload your TypeScript files or paste code directly |
| 60 | +3. Configure documentation settings |
| 61 | +4. Generate documentation |
| 62 | +5. Download or preview the results |
| 63 | + |
| 64 | +## API Documentation |
| 65 | + |
| 66 | +### Endpoints |
| 67 | + |
| 68 | +#### POST /api/upload |
| 69 | +Upload TypeScript files for documentation generation. |
| 70 | + |
| 71 | +**Request Body:** |
| 72 | +```typescript |
| 73 | +{ |
| 74 | + files: File[] |
| 75 | +} |
| 76 | +``` |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +#### GET /api/status/:key |
| 81 | +Get the status of a documentation generation job. |
| 82 | + |
| 83 | + |
| 84 | +**Response:** |
| 85 | +Documentation file (HTML/Markdown) |
| 86 | + |
| 87 | +## Services |
| 88 | + |
| 89 | +### VersioningService |
| 90 | + |
| 91 | +The VersioningService provides version control functionality for documentation files, allowing you to track changes, compare versions, and manage documentation history. |
| 92 | + |
| 93 | +#### Features |
| 94 | + |
| 95 | +- Create and manage versions of documentation files |
| 96 | +- Track changes and authors for each version |
| 97 | +- Compare different versions of documentation |
| 98 | +- Tag versions for better organization |
| 99 | +- Retrieve specific versions or the latest version |
| 100 | + |
| 101 | + |
| 102 | +## Configuration |
| 103 | + |
| 104 | +The application can be configured through environment variables: |
| 105 | + |
| 106 | +- `OPENAI_API_KEY`: OpenAI API key |
| 107 | +- `ANTHROPIC_API_KEY`: Anthropic API key |
| 108 | +- `GEMINI_API_KEY`: Gemini API key |
| 109 | +- `SUPABASE_URL`: Supabase project URL |
| 110 | +- `SUPABASE_SERVICE_ROLE_KEY`: Supabase service role key for storage access |
| 111 | + |
| 112 | +## Development |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | +### Running Tests |
| 117 | + |
| 118 | +```bash |
| 119 | +npm test |
| 120 | +``` |
| 121 | + |
| 122 | +### Building for Production |
| 123 | + |
| 124 | +```bash |
| 125 | +npm run build |
| 126 | +``` |
| 127 | + |
| 128 | +## Deployment |
| 129 | + |
| 130 | +### Production Deployment |
| 131 | + |
| 132 | +1. Build the application: |
| 133 | +```bash |
| 134 | +npm run build |
| 135 | +``` |
| 136 | + |
| 137 | +2. Start the production server: |
| 138 | +```bash |
| 139 | +npm start |
| 140 | +``` |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | +## Contributing |
| 145 | + |
| 146 | +1. Fork the repository |
| 147 | +2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
| 148 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 149 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 150 | +5. Open a Pull Request |
| 151 | + |
0 commit comments