AI-Powered Role-Specific Documentation Generator
DocFlow Lite automatically analyzes your GitHub repositories using Gemini AI and generates personalized, role-specific documentation that makes onboarding faster and easier for developers. It creates comprehensive guides tailored for backend, frontend, DevOps, or any other development role and automatically submits them as pull requests to your repository.
- π€ AI-Powered Analysis: Uses Google's Gemini AI to intelligently analyze your codebase
- π― Role-Specific Documentation: Generates targeted guides for different developer roles (backend, frontend, DevOps, etc.)
- π Automatic Pull Requests: Creates and submits documentation directly to your GitHub repository
- π Smart Code Understanding: Analyzes functions, dependencies, architecture, and workflows
- π Web Interface: Easy-to-use frontend for repository connection and documentation generation
- β‘ Fast Processing: Efficient analysis of repositories up to 10 files for quick results
Before you begin, ensure you have:
- Node.js (v18 or higher)
- npm or yarn
- GitHub Personal Access Token with repository permissions
- Google Gemini API Key
git clone <your-repo-url>
cd docflow-lite# Install root dependencies
npm install
# Install backend dependencies
cd backend && npm install && cd ..
# Install frontend dependencies
cd frontend && npm install && cd ..Create a .env file in the /backend directory:
# backend/.env
GITHUB_TOKEN=your_github_personal_access_token_here
GEMINI_API_KEY=your_google_gemini_api_key_here
NODE_ENV=development
PORT=3001
FRONTEND_URL=http://localhost:3000GitHub Token:
- Go to GitHub Settings β Developer settings β Personal access tokens β Tokens (classic)
- Generate new token with these permissions:
repo(Full control of private repositories)public_repo(Access public repositories)read:org(Read org and team membership)
Gemini API Key:
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy the key to your
.envfile
# Start both frontend and backend servers
npm run devThis will start:
- Backend: http://localhost:3001
- Frontend: http://localhost:3000
- Open your browser to
http://localhost:3000 - Enter a GitHub repository URL (e.g.,
https://github.com/yourusername/your-repo) - Select your target role (backend, frontend, devops, etc.)
- Click "Generate Documentation"
- Wait for the AI analysis to complete
- Check your GitHub repository for the new pull request with generated documentation
You can also use the API directly:
curl -X POST http://localhost:3001/api/generate/generate-docs \
-H "Content-Type: application/json" \
-d '{
"repoUrl": "https://github.com/yourusername/your-repo",
"role": "backend"
}'docflow-lite/
βββ README.md # This file
βββ package.json # Root package configuration
βββ backend/ # Node.js/Express backend
β βββ src/
β β βββ routes/
β β β βββ github.js # GitHub integration routes
β β β βββ simpleDocGeneration.js # Main documentation generation
β β β βββ docs.js # Legacy documentation routes
β β β βββ chat.js # AI chat functionality
β β βββ services/ # Business logic services
β β βββ index.js # Server entry point
β βββ package.json # Backend dependencies
β βββ .env # Environment variables
βββ frontend/ # Next.js frontend
βββ src/
β βββ pages/ # Next.js pages
β βββ components/ # React components
β βββ services/ # API service layer
βββ package.json # Frontend dependencies
βββ next.config.js # Next.js configuration
The system currently supports these developer roles:
backend- Backend/API developersfrontend- Frontend/UI developersdevops- DevOps/Infrastructure engineersfullstack- Full-stack developersmobile- Mobile app developersdata- Data scientists/engineers
You can customize the documentation generation by modifying:
- Templates: Edit the prompts in
/backend/src/routes/simpleDocGeneration.js - Analysis Logic: Modify the Gemini analysis prompts
- UI Components: Customize React components in
/frontend/src/components/
# Health check
curl http://localhost:3001/health
# Test documentation generation
curl -X POST http://localhost:3001/api/generate/generate-docs \
-H "Content-Type: application/json" \
-d '{"repoUrl": "https://github.com/yourusername/test-repo", "role": "backend"}'# Test Gemini analysis only
curl -X POST http://localhost:3001/api/github/test-gemini-analysis \
-H "Content-Type: application/json" \
-d '{"repoUrl": "https://github.com/yourusername/test-repo"}'DocFlow creates comprehensive documentation including:
- π― Project Overview - Role-specific project understanding
- π Quick Start Guide - Setup instructions for that role
- ποΈ Architecture Overview - System design from role perspective
- π§ Key Components - Important parts for that role
- π¦ Dependencies & Tools - Relevant technologies
- π οΈ Development Workflow - Role-specific processes
- π§ͺ Testing & Debugging - Testing approaches
- π Additional Resources - Role-relevant links and docs
docs/
βββ README.md # Documentation index
βββ {role}-guide.md # Role-specific guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Server won't start:
- Check that your
.envfile is in the/backenddirectory - Verify your API keys are correctly set
- Ensure ports 3000 and 3001 are available
Documentation generation fails:
- Verify your GitHub token has correct permissions
- Check that the repository URL is publicly accessible
- Ensure your Gemini API key is valid and has quota
Frontend can't connect to backend:
- Confirm backend is running on port 3001
- Check browser console for CORS errors
- Verify
FRONTEND_URLin backend.envmatches your frontend URL
Enable detailed logging by setting:
NODE_ENV=developmentFor issues and support:
- Check the Issues page
- Create a new issue with detailed error information
- Include your environment details and steps to reproduce
Made with β€οΈ using Gemini AI and modern web technologies