Components
Git2Docs consists of several interconnected components that work together to generate and serve documentation.
GitHub Integration
Git2Docs connects to your repositories via a GitHub App. This provides:
- Secure access - Fine-grained permissions to only the repos you select
- Webhook events - Automatic triggers on releases and pushes
- Repository cloning - Access to clone repos for analysis
The GitHub App can be installed at the organization level, granting access to multiple repositories at once.
Documentation Engine (Worker)
The worker is the core processing engine that analyzes your codebase and coordinates with AI to generate documentation. It runs as a background service and handles:
- Repository cloning - Fetches code at specific tags/branches
- Code parsing - Uses tree-sitter to parse TypeScript, Python, and other languages
- Artifact extraction - Identifies functions, classes, types, and their relationships
- AI orchestration - Manages the three-stage pipeline (Comprehend → Plan → Synthesize)
- Change detection - Tracks what changed between versions using dual-hash pattern
AI Language Model
Git2Docs uses Claude (Anthropic's AI) to understand code and generate documentation. The AI is used in multiple stages:
- Comprehension - Understanding what the product does and who it's for
- Planning - Designing the documentation structure and table of contents
- Synthesis - Writing the actual documentation content
Each AI call is carefully crafted with context about the codebase, existing documentation, and the specific task at hand.
Data Store
PostgreSQL stores all documentation data with a multi-tenant architecture:
| Table | Purpose |
|---|---|
organization | Teams and their settings |
repository | Connected GitHub repos |
doc_brief | Product briefs from comprehension stage |
doc_space | Documentation spaces (e.g., "User Guide") |
doc_node | Individual documentation pages |
doc_section | Content sections within pages |
doc_section_version | Version history with provenance tracking |
brand_config | Branding settings (logo, colors) |
Web Application
The Next.js web app provides two main interfaces:
Documentation Portal
A public-facing site where users browse documentation. Features include:
- Product landing pages with cards for each documentation space
- Hierarchical navigation with sidebar
- Full-text search (coming soon)
- Custom branding per organization
Team Dashboard
A private interface for teams to manage their documentation:
- Connect and manage GitHub repositories
- Trigger documentation generation
- Review and edit AI-generated content
- Configure branding and settings
- View generation progress in real-time