A production-ready Django web application that leverages AI models to automate GitHub workflows including AI-driven issue management, automated documentation generation, semantic versioning, and code documentation extraction.
- Automatically generates structured sub-issues (functional requirements, test plans, etc.) from parent issues
- Creates AI-powered README updates by analyzing repository files
- Auto-Issue Generation: Automatically analyzes repository for maintenance tasks and creates GitHub issues
- Code quality analysis
- TODO/FIXME scanning
- Documentation gap detection
- Dependency checks
- Test coverage analysis
- YAML-driven templates for customizable and consistent issue generation
- Full REST API and web interface for issue management
- React-based Web UI for interactive AI conversations
- Multi-provider support (OpenAI, XAI/Grok, Anthropic) with dynamic model selection
- Team Lead Dashboard: Query repository context and get instant answers without reading documentation
- Response caching to reduce API costs and improve latency
- Message history with role-based styling
- Accessible at
/chatwhen running the frontend (npm run devinfrontend/)
- Simple form interface for submitting bug reports and feature requests
- AI generates well-formatted GitHub issues with proper labels and structure
- REST API endpoint:
POST /api/issues/issues/create-from-feedback/ - Supports context files to provide additional repository context
- Generates changelog entries from commit messages and diffs
- Extracts and documents Python code docstrings and comments
- Supports both push and pull request events
- Database-backed documentation tracking
- Intelligent version bumping based on commit message tags (
[major],[minor],[patch]) - Syncs with Git tags for consistency
- Version history tracking with database persistence
- AI-powered PRD management: Automatically distills and evolves PRD.md from repository signals
- Multi-document sync: Keeps README.md, PRD.md, and IP.md aligned and consistent
- Zero-touch mode: Optional lock to prevent human edits ("I got this, meatbag")
- Conflict detection: AI-powered comparison of documentation vs actual codebase
- Export to GitHub: Generate issues from MVP user stories, changelog from version diffs
- Slack alerts: Real-time notifications for high-severity conflicts
- Management command:
python manage.py prd_machine --distill --repo owner/repo
- Django 4.2+ with PostgreSQL database
- Docker containerization for easy deployment
- REST API with Django REST Framework
- Async processing with Celery and Redis
- Admin interface for all operations
- API caching to reduce AI API costs
- Comprehensive logging for auditing
# Clone repository
git clone https://github.com/bamr87/githubai.git
cd githubai
# Setup environment
cp .env.example .env
# Edit .env and add your AI_API_KEY and GITHUB_TOKEN
# Run automated setup
chmod +x start.sh
./start.sh
# Access application
open http://localhost:8000/admin/# Build containers
./build.sh
# Start services
docker-compose up -d
# Initialize database
./init.sh
# Create superuser
docker-compose exec web python manage.py createsuperuser# Create AI-generated sub-issue
docker-compose exec web python manage.py create_issue \
--repo owner/repo \
--parent 123
# Create README update
docker-compose exec web python manage.py create_issue \
--repo owner/repo \
--issue-number 456 \
--readme-update
# Generate documentation
docker-compose exec web python manage.py generate_docs --file path/to/file.py
docker-compose exec web python manage.py generate_docs --commit HEAD
# Bump version
docker-compose exec web python manage.py bump_version
docker-compose exec web python manage.py bump_version --type minor
# Auto-generate repository maintenance issues
docker-compose exec web python manage.py auto_issue --list-chores
docker-compose exec web python manage.py auto_issue --chore-type code_quality
docker-compose exec web python manage.py auto_issue --chore-type todo_scan --files "apps/core/services/*.py"
docker-compose exec web python manage.py auto_issue --chore-type general_review --dry-run# Health check
curl http://localhost:8000/health/
# List issues
curl http://localhost:8000/api/issues/issues/
# Create sub-issue via API
curl -X POST http://localhost:8000/api/issues/issues/create-sub-issue/ \
-H "Content-Type: application/json" \
-d '{
"repo": "owner/repo",
"parent_issue_number": 123,
"file_refs": ["README.md"]
}'
# Create GitHub issue from user feedback
curl -X POST http://localhost:8000/api/issues/issues/create-from-feedback/ \
-H "Content-Type: application/json" \
-d '{
"feedback_type": "bug",
"summary": "Login button not working",
"description": "When I click the login button on the homepage, nothing happens.",
"repo": "owner/repo",
"context_files": ["README.md"]
}'
# Auto-generate repository maintenance issue
curl -X POST http://localhost:8000/api/issues/issues/create-auto-issue/ \
-H "Content-Type: application/json" \
-d '{
"chore_type": "code_quality",
"repo": "bamr87/githubai",
"context_files": ["apps/core/services/issue_service.py"],
"auto_submit": true
}'
# List templates
curl http://localhost:8000/api/issues/templates/Access Django admin at http://localhost:8000/admin/:
- Manage issues and templates
- View AI response cache and hit rates
- Monitor API logs
- Track version history
- Review changelog entries
githubai/
βββ apps/ # Django applications
β βββ core/ # Consolidated app (models, services, views)
β β βββ models.py # All domain models (AI, GitHub, Issues)
β β βββ services/ # Business logic (AIService, GitHubService, etc.)
β β βββ views.py # REST API endpoints
β β βββ admin.py # Django admin with custom actions
β βββ prd_machine/ # PRD MACHINE automation
β β βββ services/core.py # PRDMachineService (distill, sync, export)
β β βββ models.py # PRDState, PRDVersion, PRDConflict
β β βββ tasks.py # Celery tasks for GitHub webhooks
β βββ githubai/ # Django project settings
βββ frontend/ # React + Vite UI for AI chat
βββ docs/ # Project documentation
βββ infra/ # Infrastructure (Docker, nginx, scripts)
βββ tests/ # Test suite
βββ manage.py # Django entry point
βββ PRD.md # Product Requirements Document
βββ IP.md # Implementation Plan
βββ VERSION # Current version (0.5.0)
The application includes 6 containerized services:
- web: Django application server
- db: PostgreSQL database
- redis: Cache and message broker
- celery_worker: Background task processor
- celery_beat: Scheduled task scheduler
- nginx: Reverse proxy and static file server
Key environment variables in .env:
# Django
DJANGO_SECRET_KEY=your-secret-key
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
# Database
DATABASE_URL=postgresql://user:pass@db:5432/githubai
# APIs
AI_API_KEY=your-ai-key
GITHUB_TOKEN=your-github-token
# OpenAI
AI_MODEL=gpt-4o-mini
AI_TEMPERATURE=0.2
AI_MAX_TOKENS=2500docker-compose -f infra/docker/docker-compose.yml -f infra/docker/docker-compose.dev.yml upFeatures hot-reload, debug mode, and verbose logging.
docker-compose -f infra/docker/docker-compose.yml exec web pytest
docker-compose -f infra/docker/docker-compose.yml exec web pytest --cov# All services
docker-compose -f infra/docker/docker-compose.yml logs -f
# Specific service
docker-compose -f infra/docker/docker-compose.yml logs -f web
docker-compose -f infra/docker/docker-compose.yml logs -f celery_workerGET /api/issues/issues/- List all issuesPOST /api/issues/issues/- Create new issueGET /api/issues/issues/{id}/- Get issue detailsPOST /api/issues/issues/create-sub-issue/- Create sub-issuePOST /api/issues/issues/create-readme-update/- Create README updatePOST /api/issues/issues/create-from-feedback/- Create issue from user feedbackPOST /api/issues/issues/create-auto-issue/- Auto-generate maintenance issueGET /api/issues/templates/- List issue templates
GET /health/- Health check endpointGET /admin/- Django admin interface
The Django management commands can be used in GitHub Actions workflows. See Development Documentation for examples.
- Getting Started - Quick setup guide for new users
- Documentation Index - Complete documentation navigation
- Auto Issue Feature - Automated repository analysis
- AI Chat Interface - Using the web chat interface
- AI Provider Configuration - Configure OpenAI, XAI, etc.
- Troubleshooting - Common issues and solutions
- Auto Issue Endpoints - REST API for auto-issue generation
- Chat Endpoint - Conversational AI API
- Interactive API - Browse API when server is running
- Django Implementation - Architecture and design
- Testing Guide - How to test features
- Contributing - How to contribute
- Changelog - All version changes
- v0.3.0 Release - AI Chat Frontend
- v0.2.0 Release - Auto Issue Generation
Contributions are welcome! Please see our Contributing Guide for details on:
- Development setup
- Coding standards
- Testing guidelines
- Pull request process
Quick start:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Submit a pull request
See docs/development/contributing.md for complete guidelines.
docker-compose -f infra/docker/docker-compose.yml down
docker-compose -f infra/docker/docker-compose.yml up -d db
# Wait 10 seconds
docker-compose -f infra/docker/docker-compose.yml updocker-compose -f infra/docker/docker-compose.yml down -v
docker-compose -f infra/docker/docker-compose.yml up -d db
docker-compose -f infra/docker/docker-compose.yml exec web python manage.py migratedocker-compose -f infra/docker/docker-compose.yml ps
curl http://localhost:8000/health/MIT License